forked from github/pelican
Use rich logging for Pelican server
This commit is contained in:
parent
e2c73a0a16
commit
0b9a488c26
2 changed files with 6 additions and 2 deletions
|
|
@ -487,8 +487,8 @@ def listen(server, port, output, excqueue=None):
|
|||
return
|
||||
|
||||
try:
|
||||
print("\nServing site at: http://{}:{} - Tap CTRL-C to stop".format(
|
||||
server, port))
|
||||
console.print("Serving site at: http://{}:{} - Tap CTRL-C to stop".format(
|
||||
server, port))
|
||||
httpd.serve_forever()
|
||||
except Exception as e:
|
||||
if excqueue is not None:
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ try:
|
|||
except ImportError:
|
||||
magic_from_file = None
|
||||
|
||||
from pelican.log import console # noqa: F401
|
||||
from pelican.log import init as init_logging
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -104,6 +105,9 @@ class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler):
|
|||
|
||||
return mimetype
|
||||
|
||||
def log_message(self, format, *args):
|
||||
logger.info(format, *args)
|
||||
|
||||
|
||||
class RootedHTTPServer(server.HTTPServer):
|
||||
def __init__(self, base_path, *args, **kwargs):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue