mirror of https://github.com/zulip/zulip.git
logging: Abbreviate logger name for some extremely common logs.
These are the records that we print on each web request.
This commit is contained in:
parent
71b8e7e8d4
commit
cc288dacc5
|
@ -125,12 +125,14 @@ def skip_site_packages_logs(record):
|
|||
return False
|
||||
return True
|
||||
|
||||
logger_nicknames = {
|
||||
'root': '', # This one is more like undoing a nickname.
|
||||
'zulip.requests': 'zr', # Super common.
|
||||
}
|
||||
|
||||
def find_log_origin(record):
|
||||
# type: (logging.LogRecord) -> str
|
||||
if record.name == 'root':
|
||||
return ''
|
||||
else:
|
||||
return record.name
|
||||
return logger_nicknames.get(record.name, record.name)
|
||||
|
||||
class ZulipFormatter(logging.Formatter):
|
||||
# Used in the base implementation. Default uses `,`.
|
||||
|
|
Loading…
Reference in New Issue