def get_module_logger(cls, mod, logdir):
"""
Returns a logging.Logger specific to the given module.
If the logger has not yet been configured, it will be created with default options
by LogUtil.create_module_logger()
Parameters:
mod (Module): module to return a logger for
logdir (str): the log directory path
Returns:
(logger): logging.Logger specific to the given ec2rlcore.module
"""
if "{}:{}".format(mod.placement, mod.name) not in cls._module_loggers:
cls.create_module_logger(mod, logdir)
return logging.getLogger("ec2rl").getChild("module").getChild(mod.placement).getChild(mod.name)
评论列表
文章目录