# HG changeset patch # User Tuomo Valkonen # Date 1517162054 0 # Node ID 2fe66644c50db5a2bcb78f23b7f2596bba77a726 # Parent 56a000d15965e7e32acbc91c99825b57a68ff83e Can use logging.getLogger directly now after proper packageisation diff -r 56a000d15965 -r 2fe66644c50d borgend/backup.py --- 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 diff -r 56a000d15965 -r 2fe66644c50d borgend/config.py --- 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 diff -r 56a000d15965 -r 2fe66644c50d borgend/dreamtime.py --- 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 diff -r 56a000d15965 -r 2fe66644c50d borgend/instance.py --- 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'] diff -r 56a000d15965 -r 2fe66644c50d borgend/loggers.py --- 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) diff -r 56a000d15965 -r 2fe66644c50d borgend/repository.py --- 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): diff -r 56a000d15965 -r 2fe66644c50d borgend/scheduler.py --- 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() diff -r 56a000d15965 -r 2fe66644c50d borgend/ui.py --- 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.',