mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-08 09:28:41 +00:00
Added filemode support to setupLogger.
This allows log files to be appended to if desired.
This commit is contained in:
parent
ac418d5935
commit
100227f4e1
1 changed files with 2 additions and 2 deletions
|
@ -34,7 +34,7 @@ levels = {
|
||||||
"none": logging.CRITICAL,
|
"none": logging.CRITICAL,
|
||||||
"debug": logging.DEBUG
|
"debug": logging.DEBUG
|
||||||
}
|
}
|
||||||
def setupLogger(level="error", filename=None):
|
def setupLogger(level="error", filename=None, filemode="w"):
|
||||||
"""
|
"""
|
||||||
Sets up the basic logger and if `:param:filename` is set, then it will log
|
Sets up the basic logger and if `:param:filename` is set, then it will log
|
||||||
to that file instead of stdout.
|
to that file instead of stdout.
|
||||||
|
@ -51,7 +51,7 @@ def setupLogger(level="error", filename=None):
|
||||||
format="[%(levelname)-8s] %(asctime)s %(module)s:%(lineno)d %(message)s",
|
format="[%(levelname)-8s] %(asctime)s %(module)s:%(lineno)d %(message)s",
|
||||||
datefmt="%H:%M:%S",
|
datefmt="%H:%M:%S",
|
||||||
filename=filename,
|
filename=filename,
|
||||||
filemode="w"
|
filemode=filemode
|
||||||
)
|
)
|
||||||
|
|
||||||
def setLoggerLevel(level):
|
def setLoggerLevel(level):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue