config_logger#
- ams.main.config_logger(stream_level=20, *, stream=True, file=True, log_file='ams.log', log_path=None, file_level=10)[source]#
Configure an AMS logger with a FileHandler and a StreamHandler.
This function is called at the beginning of
ams.main.main(). Updatingstream_levelandfile_levelis now supported.- Parameters:
- streambool, optional
Create a StreamHandler for stdout if
True. IfFalse, the handler will not be created.- filebool, optional
True if logging to
log_file.- log_filestr, optional
Logg file name for FileHandler,
'ams.log'by default. IfNone, the FileHandler will not be created.- log_pathstr, optional
Path to store the log file. By default, the path is generated by get_log_dir() in utils.misc.
- stream_level{10, 20, 30, 40, 50}, optional
StreamHandler verbosity level.
- file_level{10, 20, 30, 40, 50}, optional
FileHandler verbosity level.
- Returns:
- None
Notes
Copied from the ANDES project: CURENT/andes
Original author: Hantao Cui
License: GNU General Public License v3.0 (GPL-3.0)