about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorael-code <tommy.ael@gmail.com>2016-11-08 20:03:49 +0100
committerael-code <tommy.ael@gmail.com>2016-11-25 15:16:08 +0100
commit3767ccacb68c8e6131d41958e89a0f80da32e577 (patch)
treedc3eabae702acdea176382fcceb88a57fb43ae3f
parent055247a002757ab439e68f8497b3935f28a839c4 (diff)
downloadranger-3767ccacb68c8e6131d41958e89a0f80da32e577.tar.gz
Removed unused logging helper function
-rw-r--r--ranger/__init__.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py
index 4d8e4afe..9c4f8922 100644
--- a/ranger/__init__.py
+++ b/ranger/__init__.py
@@ -29,44 +29,9 @@ CACHEDIR = os.path.expanduser("~/.cache/ranger")
 USAGE = '%prog [options] [path]'
 VERSION = 'ranger-master %s\n\nPython %s' % (__version__, sys.version)
 
-try:
-    ExceptionClass = FileNotFoundError
-except NameError:
-    ExceptionClass = IOError
-try:
-    LOGFILE = tempfile.gettempdir() + '/ranger_errorlog'
-except ExceptionClass:
-    LOGFILE = '/dev/null'
-del ExceptionClass
 
 # If the environment variable XDG_CONFIG_HOME is non-empty, CONFDIR is ignored
 # and the configuration directory will be $XDG_CONFIG_HOME/ranger instead.
 CONFDIR = '~/.config/ranger'
 
-# Debugging functions.  These will be activated when run with --debug.
-# Example usage in the code:
-# import ranger; ranger.log("hello world")
-
-
-def log(*objects, **keywords):
-    """Writes objects to a logfile (for the purpose of debugging only.)
-    Has the same arguments as print() in python3.
-    """
-    from ranger import arg
-    if LOGFILE is None or not arg.debug or arg.clean:
-        return
-    start = keywords.get('start', 'ranger:')
-    sep   = keywords.get('sep', ' ')
-    end   = keywords.get('end', '\n')
-    _file = keywords['file'] if 'file' in keywords else open(LOGFILE, 'a')
-    _file.write(sep.join(map(str, (start, ) + objects)) + end)
-
-
-def log_traceback():
-    from ranger import arg
-    if LOGFILE is None or not arg.debug or arg.clean:
-        return
-    import traceback
-    traceback.print_stack(file=open(LOGFILE, 'a'))
-
 from ranger.core.main import main
href='#n181'>181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315