Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

abstract_logger.py 1005 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
  1. import logging
  2. import logging.config
  3. from super_gradients.common.auto_logging import AutoLoggerConfig
  4. # Do not remove, it's necessary for the get_logger functionality.
  5. from cmreslogging.handlers import CMRESHandler
  6. def get_logger(logger_name: str, training_log_path=None, logs_dir_path=None) -> logging.Logger:
  7. config_dict = AutoLoggerConfig.generate_config_for_module_name(module_name=logger_name,
  8. training_log_path=training_log_path,
  9. logs_dir_path=logs_dir_path)
  10. logging.config.dictConfig(config_dict)
  11. logger: logging.Logger = logging.getLogger(logger_name)
  12. return logger
  13. class ILogger:
  14. """
  15. Provides logging capabilities to the derived class.
  16. """
  17. def __init__(self, logger_name: str = None):
  18. logger_name = logger_name if logger_name else str(self.__module__)
  19. self._logger: logging.Logger = get_logger(logger_name)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...