diff options
| author | Scott Gasch <[email protected]> | 2021-07-08 19:44:27 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2021-07-08 19:44:27 -0700 |
| commit | 3bc4daf1edc121cd633429187392227f2fa61885 (patch) | |
| tree | 0663cf35f562c7023c914454c85050d502ad9f3c /logging_utils.py | |
| parent | 5fd30ef12c100cbb936aa0fdb515b67cff4064db (diff) | |
Lots of changes.
Diffstat (limited to 'logging_utils.py')
| -rw-r--r-- | logging_utils.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/logging_utils.py b/logging_utils.py index 03a23d9..a24f1c9 100644 --- a/logging_utils.py +++ b/logging_utils.py @@ -15,17 +15,17 @@ import config import string_utils as su import thread_utils as tu -parser = config.add_commandline_args( +cfg = config.add_commandline_args( f'Logging ({__file__})', 'Args related to logging') -parser.add_argument( +cfg.add_argument( '--logging_config_file', type=argparse_utils.valid_filename, default=None, metavar='FILENAME', help='Config file containing the logging setup, see: https://docs.python.org/3/howto/logging.html#logging-advanced-tutorial', ) -parser.add_argument( +cfg.add_argument( '--logging_level', type=str, default='INFO', @@ -33,59 +33,59 @@ parser.add_argument( metavar='LEVEL', help='The level below which to squelch log messages.', ) -parser.add_argument( +cfg.add_argument( '--logging_format', type=str, default='%(levelname)s:%(asctime)s: %(message)s', help='The format for lines logged via the logger module.' ) -parser.add_argument( +cfg.add_argument( '--logging_date_format', type=str, default='%Y/%m/%dT%H:%M:%S.%f%z', metavar='DATEFMT', help='The format of any dates in --logging_format.' ) -parser.add_argument( +cfg.add_argument( '--logging_console', action=argparse_utils.ActionNoYes, default=True, help='Should we log to the console (stderr)', ) -parser.add_argument( +cfg.add_argument( '--logging_filename', type=str, default=None, metavar='FILENAME', help='The filename of the logfile to write.' ) -parser.add_argument( +cfg.add_argument( '--logging_filename_maxsize', type=int, default=(1024*1024), metavar='#BYTES', help='The maximum size (in bytes) to write to the logging_filename.' ) -parser.add_argument( +cfg.add_argument( '--logging_filename_count', type=int, default=2, metavar='COUNT', help='The number of logging_filename copies to keep before deleting.' ) -parser.add_argument( +cfg.add_argument( '--logging_syslog', action=argparse_utils.ActionNoYes, default=False, help='Should we log to localhost\'s syslog.' ) -parser.add_argument( +cfg.add_argument( '--logging_debug_threads', action=argparse_utils.ActionNoYes, default=False, help='Should we prepend pid/tid data to all log messages?' ) -parser.add_argument( +cfg.add_argument( '--logging_info_is_print', action=argparse_utils.ActionNoYes, default=False, |
