Function
setup_default_logging
(save_path, flag_multigpus=False, l_level='INFO')
Source from the content-addressed store, hash-verified
| 214 | |
| 215 | |
| 216 | def setup_default_logging(save_path, flag_multigpus=False, l_level='INFO'): |
| 217 | |
| 218 | if flag_multigpus: |
| 219 | rank = dist.get_rank() |
| 220 | if rank != 0: |
| 221 | return |
| 222 | |
| 223 | tmp_timestr = time_str(fmt='%Y_%m_%d_%H_%M_%S') |
| 224 | logger.add( |
| 225 | os.path.join(save_path, f'{tmp_timestr}.log'), |
| 226 | # level='DEBUG', |
| 227 | level=l_level, |
| 228 | # format='{time:YYYY-MM-DD HH:mm:s} {file}[{line}] {level}: {message}', |
| 229 | format='{level}|{time:YYYY-MM-DD HH:mm:ss}: {message}', |
| 230 | # retention='30 days', |
| 231 | # rotation='30mb', |
| 232 | enqueue=True, |
| 233 | encoding='utf-8', |
| 234 | ) |
| 235 | return tmp_timestr |
| 236 | |
| 237 | |
| 238 | |
Callers
nothing calls this directly
Tested by
no test coverage detected