Can use logging.getLogger directly now after proper packageisation

Sun, 28 Jan 2018 17:54:14 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Sun, 28 Jan 2018 17:54:14 +0000
changeset 86
2fe66644c50d
parent 85
56a000d15965
child 87
a214d475aa28

Can use logging.getLogger directly now after proper packageisation

borgend/backup.py file | annotate | diff | comparison | revisions
borgend/config.py file | annotate | diff | comparison | revisions
borgend/dreamtime.py file | annotate | diff | comparison | revisions
borgend/instance.py file | annotate | diff | comparison | revisions
borgend/loggers.py file | annotate | diff | comparison | revisions
borgend/repository.py file | annotate | diff | comparison | revisions
borgend/scheduler.py file | annotate | diff | comparison | revisions
borgend/ui.py file | annotate | diff | comparison | revisions
--- a/borgend/backup.py	Sun Jan 28 17:34:06 2018 +0000
+++ b/borgend/backup.py	Sun Jan 28 17:54:14 2018 +0000
@@ -9,13 +9,12 @@
 from threading import Thread, Lock, Condition
 
 from . import config
-from . import loggers
 from . import repository
 from . import dreamtime
 from .instance import BorgInstance
 from .scheduler import TerminableThread
 
-_logger=loggers.get(__name__)
+_logger=logging.getLogger(__name__)
 
 JOIN_TIMEOUT=60
 
--- a/borgend/config.py	Sun Jan 28 17:34:06 2018 +0000
+++ b/borgend/config.py	Sun Jan 28 17:54:14 2018 +0000
@@ -11,11 +11,10 @@
 import platform
 from functools import reduce
 
-from . import loggers
 from . import branding
 from . import locations
 
-logger=loggers.get(__name__)
+logger=logging.getLogger(__name__)
 
 #
 # Defaults
--- a/borgend/dreamtime.py	Sun Jan 28 17:34:06 2018 +0000
+++ b/borgend/dreamtime.py	Sun Jan 28 17:54:14 2018 +0000
@@ -9,10 +9,9 @@
 import threading
 import weakref
 import datetime
+import logging
 
-from . import loggers
-
-logger=loggers.get(__name__)
+logger=logging.getLogger(__name__)
 
 _dreamtime_monitor=None
 
--- a/borgend/instance.py	Sun Jan 28 17:34:06 2018 +0000
+++ b/borgend/instance.py	Sun Jan 28 17:54:14 2018 +0000
@@ -7,10 +7,9 @@
 import logging
 from subprocess import Popen, PIPE
 
-from . import loggers
 from .config import settings
 
-logger=loggers.get(__name__)
+logger=logging.getLogger(__name__)
 
 necessary_opts=['--log-json', '--progress']
 
--- a/borgend/loggers.py	Sun Jan 28 17:34:06 2018 +0000
+++ b/borgend/loggers.py	Sun Jan 28 17:54:14 2018 +0000
@@ -63,5 +63,5 @@
 #
 
 def get(name):
-    return mainlogger.getChild(name)
-
+    #return mainlogger.getChild(name)
+    return logging.getLogger(name)
--- a/borgend/repository.py	Sun Jan 28 17:34:06 2018 +0000
+++ b/borgend/repository.py	Sun Jan 28 17:54:14 2018 +0000
@@ -4,12 +4,12 @@
 
 import weakref
 import keyring
+import logging
 
-from . import loggers
 from . import config
 from .scheduler import QueueThread, QueuedEvent
 
-logger=loggers.get(__name__)
+logger=logging.getLogger(__name__)
 
 class FIFOEvent(QueuedEvent):
     def __init__(self, cond, name=None):
--- a/borgend/scheduler.py	Sun Jan 28 17:34:06 2018 +0000
+++ b/borgend/scheduler.py	Sun Jan 28 17:54:14 2018 +0000
@@ -5,12 +5,12 @@
 #
 
 import time
+import logging
 from threading import Condition, Thread
 
-from . import loggers
 from . import dreamtime
 
-logger=loggers.get(__name__)
+logger=logging.getLogger(__name__)
 
 class QueuedEvent:
     def __init__(self, cond, name=None):
@@ -129,7 +129,7 @@
                     timeout=min(self.precision, self._list.when.realtime()-now)
 
                 if not timeout or timeout>0:
-                    logger.debug("Scheduler waiting %d seconds" % (timeout or (-1)))
+                    logger.debug("Scheduler waiting %s seconds" % str(timeout))
                     self._cond.wait(timeout)
                     now = time.monotonic()
 
--- a/borgend/ui.py	Sun Jan 28 17:34:06 2018 +0000
+++ b/borgend/ui.py	Sun Jan 28 17:54:14 2018 +0000
@@ -5,16 +5,16 @@
 import rumps
 import time
 import datetime
+import logging
 import objc
 from threading import Lock, Timer
 
-from . import loggers
 from . import backup
 from . import dreamtime
 from . import branding
 from .config import settings
 
-logger=loggers.get(__name__)
+logger=logging.getLogger(__name__)
 
 traynames_ok={
     backup.State.INACTIVE: 'B.',

mercurial