Open mxkrn opened 1 year ago
Implement these helper functions.
import logging def init_logger( name: str = "klay_beam", # or other package name level: int = logging.INFO, format: str = DEFAULT_LOG_FORMAT, ) -> logging.Logger: logger = logging.getLogger(name) logger.setLevel(level) if not logger.hasHandlers(): formatter = logging.Formatter(format) streamHandler = logging.StreamHandler() streamHandler.setFormatter(formatter) logger.addHandler(streamHandler) return logger def get_logger(name: str) -> logging.Logger: return logging.getLogger(name)
Logger instances can then be called in modules using: get_logger(__name__)
get_logger(__name__)
Sounds good. We just have to double check that there is a nice way to tell the GCP Dataflow runner to use a named logger.
Implement these helper functions.
Logger instances can then be called in modules using:
get_logger(__name__)