logger: add optional format arguments to default_logger
default_logger
function accepts optional arguments for the format of the console and file loggers
For example for readable indentation with longer function names (e.g. with FSI or ROUKF, 30 chars instead of 8):
loglevel = "DEBUG"
fmt_console = (
f"<lvl>{{level:<{len(loglevel)}}}</> | "
"<c>{extra[classname]:<30}:{function:<30}</> - <lvl>{message}</>"
)
fmt_file = (
f"{{time:YYYY-MM-DDTHH:mm:ss.SSS}} ({{elapsed}}) | {{level:<{len(loglevel)}}} | "
"{extra[classname]:<30}:{function:<30} - {message}"
)
...
# something like:
default_logger(
Path(options_fsi["io"]["write_path"]).joinpath("run.log"),
level=loglevel,
fmt_console=fmt_console,
fmt_file=fmt_file,
)
Edited by D.J. Nolte