Good afternoon, I am struggling with logging into...
# questions
f
Good afternoon, I am struggling with logging into kedro. I understand how it works but I am running into a little problem that is very annoying. In the console I use the rich format with no problem however in my info.log it shows [/dark_orange] instead of coloring that word orange. Is there an option that can be entered in logging.yml to colour it or disable [/dark_orange] in info.log? My logginig.yml is:
Copy code
formatters:
  simple:
    format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
  long:
    format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s (%(filename)s:%(lineno)d)"

handlers:
  console:
    class: logging.StreamHandler
    level: INFO
    formatter: long
    stream: <ext://sys.stdout>

  info_file_handler:
    class: logging.handlers.RotatingFileHandler
    level: INFO
    formatter: long
    filename: info.log
    maxBytes: 10485760 # 10MB
    backupCount: 20
    encoding: utf8
    delay: True

  rich:
    class: kedro.logging.RichHandler
    rich_tracebacks: True
    tracebacks_show_locals: False

loggers:
  kedro:
    level: INFO

  generacion_informe_indicadores:
    level: INFO
    propagate: False

root:
  level: INFO
  handlers: [info_file_handler, rich]
s
I'm not sure if there is a way to colour or disable [/dark_orange] in info.log. Rich is mainly for console outputs so I recommend just keep rich for the console and use plain text formatting for the file so that no special codes appear in your log file.
j
maybe it's related to this issue @Fernando Cabeza 🤔 https://github.com/kedro-org/kedro/issues/3626 we fixed it in Kedro 0.19.7
what version of Kedro do you have?
f
I am using v0.19.9 but I satarted the project with v0.19.6. Maybe it's a configuration problem? settings.py
Copy code
config_loader = OmegaConfigLoader(
    conf_source=file_path_conf,
    base_env="base",
    config_patterns={
        "catalog": ["catalog*", "catalog*/**", "**/catalog*"],
        "parameters": ["parameters*", "parameters*/**", "**/parameters*"],
        "globals": ["globals.yml"],
        "logging": ["logging*", "logging*/**", "**/logging*"],
    },
)