mirror of
https://github.com/django/daphne.git
synced 2025-07-13 17:32:17 +03:00
Added argument to change log format
This commit is contained in:
parent
eae1ff0df4
commit
c35bb28409
|
@ -1,6 +1,6 @@
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
__version__ = "3.0.2"
|
__version__ = "3.0.3"
|
||||||
|
|
||||||
|
|
||||||
# Windows on Python 3.8+ uses ProactorEventLoop, which is not compatible with
|
# Windows on Python 3.8+ uses ProactorEventLoop, which is not compatible with
|
||||||
|
|
|
@ -90,6 +90,11 @@ class CommandLineInterface:
|
||||||
help="Where to write the access log (- for stdout, the default for verbosity=1)",
|
help="Where to write the access log (- for stdout, the default for verbosity=1)",
|
||||||
default=None,
|
default=None,
|
||||||
)
|
)
|
||||||
|
self.parser.add_argument(
|
||||||
|
"--log-fmt",
|
||||||
|
help="Log format to use",
|
||||||
|
default="%(asctime)-15s %(levelname)-8s %(message)s"
|
||||||
|
)
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
"--ping-interval",
|
"--ping-interval",
|
||||||
type=int,
|
type=int,
|
||||||
|
@ -215,7 +220,7 @@ class CommandLineInterface:
|
||||||
2: logging.DEBUG,
|
2: logging.DEBUG,
|
||||||
3: logging.DEBUG, # Also turns on asyncio debug
|
3: logging.DEBUG, # Also turns on asyncio debug
|
||||||
}[args.verbosity],
|
}[args.verbosity],
|
||||||
format="%(asctime)-15s %(levelname)-8s %(message)s",
|
format=args.log_fmt,
|
||||||
)
|
)
|
||||||
# If verbosity is 1 or greater, or they told us explicitly, set up access log
|
# If verbosity is 1 or greater, or they told us explicitly, set up access log
|
||||||
access_log_stream = None
|
access_log_stream = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user