You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My terminal outputs two logs, is there a problem where I am processing?
My intention: to format all log content in json format so that I can analyze and notify using the log collector .
Also what can I do to define the "Load configuration matching foo.ini" in json format as well?
demo.py:
importloggingfromclickimportpass_contextfromclick_extraimportextra_command, extra_basic_config, verbosity_optionextra_basic_config(
logger_name="app_logger",
format='{{"time": "{asctime}", "name": "{name}", "level": "{levelname}", "msg": "{message}"}}',
force=True,
level=logging.INFO,
)
@extra_command@pass_context@verbosity_option(default_logger="app_logger",)defcli(config):
logging.getLogger("app_logger").info("This is an info message from the root logger.")
output:
Load configuration matching foo.ini
{"time": "2024-06-18 10:35:50,018", "name": "app_logger", "level": "info", "msg": "This is an info message from the root logger."}
info: This is an info message from the root logger.
The text was updated successfully, but these errors were encountered:
Hi, when I use https://kdeldycke.github.io/click-extra/logging.html#custom-logger
My terminal outputs two logs, is there a problem where I am processing?
My intention: to format all log content in json format so that I can analyze and notify using the log collector .
Also what can I do to define the "Load configuration matching foo.ini" in json format as well?
demo.py:
output:
The text was updated successfully, but these errors were encountered: