data_juicer.utils.logger_utils module¶
- data_juicer.utils.logger_utils.get_caller_name(depth=0)[源代码]¶
Get caller name by depth.
- 参数:
depth -- depth of caller context, use 0 for caller depth.
- 返回:
module name of the caller
- class data_juicer.utils.logger_utils.StreamToLoguru(level='INFO', caller_names=('datasets', 'logging'))[源代码]¶
基类:
object
Stream object that redirects writes to a logger instance.
- data_juicer.utils.logger_utils.redirect_sys_output(log_level='INFO')[源代码]¶
Redirect stdout/stderr to loguru with log level.
- 参数:
log_level -- log level string of loguru. Default value: "INFO".
- data_juicer.utils.logger_utils.get_log_file_path()[源代码]¶
Get the path to the location of the log file.
- 返回:
a location of log file.
- data_juicer.utils.logger_utils.setup_logger(save_dir, distributed_rank=0, filename='log.txt', mode='o', level='INFO', redirect=True)[源代码]¶
Setup logger for training and testing.
- 参数:
save_dir -- location to save log file
distributed_rank -- device rank when multi-gpu environment
filename -- log file name to save
mode -- log file write mode, append or override. default is o.
level -- log severity level. It's "INFO" in default.
redirect -- whether to redirect system output
- 返回:
logger instance.