HEPCloud / decisionengine_modules

Apache License 2.0
2 stars 19 forks source link

Added and renamed module logger #362

Closed mambelli closed 3 years ago

mambelli commented 3 years ago

Added module logger for functions in glide_frontend_element.py outside the class Renamed module loggers appending the module name for more granularity

goodenou commented 3 years ago

I think we can skip the change from logger = structlog.getLogger(CHANNELLOGGERNAME) to logger = structlog.getLogger(f"{CHANNELLOGGERNAME}.{__name__}") in all three files. The resulting output in the log file is cumbersome giving the full name of the module based on the path. It is also inconsistent with the names of the of the logger given by the other modules. If we want to do this, we should it everywhere (in a later PR).

StevenCTimm commented 3 years ago

There are still some bare logger.info calls in the modified glide_frontend_element.py Are we sure that is right? There were five originally and it looks like Marco's change only gets the first one.

goodenou commented 3 years ago

There are still some bare logger.info calls in the modified glide_frontend_element.py Are we sure that is right? There were five originally and it looks like Marco's change only gets the first one.

He defines "logger" at the top of the module in line 21, so the module functions are all aware of the logger. In the class GlideFrontendElement he sets the self.logger = logger, so it picks it up as well.

goodenou commented 3 years ago

Looks good! I approve.

mambelli commented 3 years ago

@goodenou you should approve in the "files changed" tab, otherwise, it is still blocked