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
Modify the _init_logging method in the PackageCache class of the package_cache.py module to check for the presence of the REZ_LOGGING_CONF environment variable. If this variable is set, use its value as a logging configuration file and return the configured logger object. This ensures that the custom logging setup can override the default "rez-pkg-cache" logger created by the PackageCache class.
Current code:
def_init_logging(self):
""" Creates logger that logs to file and stdout. Used for: - adding variants in daemonized proc; - clean(), which would typically be run as a cron, but can also be run manually (hence the logging to stdout also) """logger=logging.getLogger("rez-pkg-cache")
logger.setLevel(logging.INFO)
logger.propagate=False
[...]
Suggestion:
def_init_logging(self):
""" Creates logger that logs to file and stdout. Used for: - adding variants in daemonized proc; - clean(), which would typically be run as a cron, but can also be run manually (hence the logging to stdout also) """logger=logging.getLogger("rez-pkg-cache")
logging_conf=os.getenv("REZ_LOGGING_CONF")
iflogging_conf:
logging.config.fileConfig(logging_conf, disable_existing_loggers=False)
returnloggerlogger.setLevel(logging.INFO)
logger.propagate=False
[...]
Motivation
Since the rez module has its own _init_logging function that implements custom logging functionality
with the environment variable REZ_LOGGING_CONF:
It would be wise to implement the same feature in the _init_logging method of the PackageCache class.
For now, we've set up our own custom handlers on the logger "rez-pkg-cache", but there are still duplicate logs and no way to remove the handlers from "rez-pkg-cache".
The text was updated successfully, but these errors were encountered:
Modify the
_init_logging
method in thePackageCache
class of thepackage_cache.py
module to check for the presence of theREZ_LOGGING_CONF
environment variable. If this variable is set, use its value as a logging configuration file and return the configured logger object. This ensures that the custom logging setup can override the default "rez-pkg-cache" logger created by the PackageCache class.Current code:
Suggestion:
Motivation
Since the
rez
module has its own_init_logging
function that implements custom logging functionalitywith the environment variable
REZ_LOGGING_CONF
:It would be wise to implement the same feature in the
_init_logging
method of thePackageCache
class.For now, we've set up our own custom handlers on the logger "rez-pkg-cache", but there are still duplicate logs and no way to remove the handlers from "rez-pkg-cache".
The text was updated successfully, but these errors were encountered: