-
-
Save kevin85421/9cf6ee70ceec42be3de888174d0c8e6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import logging.config | |
ray_data_logger_config = { | |
"version": 1, | |
"disable_existing_loggers": False, | |
"formatters": { | |
"default": { | |
"format": "%(asctime)s - %(name)s - %(levelname)s - %(message)s", | |
}, | |
}, | |
"handlers": { | |
"console": { | |
"class": "logging.StreamHandler", | |
"formatter": "default", | |
"level": "INFO", | |
}, | |
}, | |
"loggers": { | |
"Ray.data": { | |
"handlers": ["console"], | |
"level": "INFO", | |
"propagate": False, | |
}, | |
}, | |
} | |
logging.config.dictConfig(ray_data_logger_config) | |
ray_data_logger = logging.getLogger("Ray.data") | |
ray_data_logger.info("This is an INFO log from Ray.data.") | |
ray_data_logger.warning("This is a WARNING log from Ray.data.") | |
ray_data_logger.info(f"Ray data propagate {ray_data_logger.propagate}") | |
ray_logger_config = { | |
"incremental": True, | |
"version": 1, | |
"disable_existing_loggers": False, | |
"formatters": { | |
"default": { | |
"format": "abc %(name)s - %(levelname)s - %(message)s", | |
}, | |
}, | |
"handlers": { | |
"console": { | |
"class": "logging.StreamHandler", | |
"formatter": "default", | |
"level": "DEBUG", | |
}, | |
}, | |
"loggers": { | |
"Ray": { | |
"handlers": ["console"], | |
"level": "DEBUG", | |
"propagate": False, | |
}, | |
}, | |
} | |
logging.config.dictConfig(ray_logger_config) | |
ray_logger = logging.getLogger("Ray") | |
ray_logger.debug("This is a DEBUG log from Ray.") | |
ray_logger.error("This is an ERROR log from Ray.") | |
ray_data_logger.info("Another INFO log from Ray.data.") | |
ray_data_logger.info(f"Ray data propagate {ray_data_logger.propagate}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment