log_handler
log.log_handler
LogHandler
LogHandler(name: str = 'SaigeResearch', logdir: Optional[str] = None, add_time_to_logdir: bool = False, logfile: Optional[str] = None, stdout: bool = False, level: str = 'INFO', formatter: str = f'%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s', dashboard: Optional[Dict] = None)
Source code in SaigeToolkit/log/log_handler.py
skip_if_logdir_is_none
Decorator to skip the method if logdir is None.
Source code in SaigeToolkit/log/log_handler.py
save_json
Save the data in the {self.logdir}/{json_path}.
Parameters:
-
data(Dict) –data to save
-
json_path(str, default:'log.json') –json path. Defaults to "log.json".
Source code in SaigeToolkit/log/log_handler.py
save_image
Save the image in the {self.logdir}/{file_path}.
Source code in SaigeToolkit/log/log_handler.py
save_code
Save the module codes in the "source_code" directory.
Parameters:
-
target(str) –module path
-
directory(str, default:'source_code') –save directory. Defaults to "source_code".
Source code in SaigeToolkit/log/log_handler.py
save_yaml
Save the dict in yaml format.
Parameters:
-
data(Dict) –Dict to save
-
filename(str) –filename
Source code in SaigeToolkit/log/log_handler.py
save_source_info
Save current time (KST) + git info + run command in "source_info.json".
Parameters:
-
git_path(str) –git directory path.
Source code in SaigeToolkit/log/log_handler.py
save_checkpoint
Save checkpoint in the "checkpoint" directory.
Parameters:
-
trainer(Trainer) –An instance containing information to be saved in the checkpoint.
-
filename(str) –filename
-
password(Optional[str], default:None) –Password for checkpoint file. Defaults to None.
Source code in SaigeToolkit/log/log_handler.py
configure_logger
configure_logger(name: Optional[str] = 'SaigeResearch', level: str = 'INFO', formatter: str = f'%(asctime)s %(levelname)s [%(filename)s:%(lineno)d] %(message)s', path: Optional[str] = None, stdout: bool = False)