diff options
author | ael-code <tommy.ael@gmail.com> | 2016-11-08 20:03:49 +0100 |
---|---|---|
committer | ael-code <tommy.ael@gmail.com> | 2016-11-25 15:16:08 +0100 |
commit | 3767ccacb68c8e6131d41958e89a0f80da32e577 (patch) | |
tree | dc3eabae702acdea176382fcceb88a57fb43ae3f | |
parent | 055247a002757ab439e68f8497b3935f28a839c4 (diff) | |
download | ranger-3767ccacb68c8e6131d41958e89a0f80da32e577.tar.gz |
Removed unused logging helper function
-rw-r--r-- | ranger/__init__.py | 35 |
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 |