diff options
| author | karnigen <karnigen@gmail.com> | 2024-05-03 01:34:58 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-03 01:34:58 +0200 |
| commit | bf5c2dfd67fac98868f86276504715ecfe1c369a (patch) | |
| tree | 3b6bd611f452156fab48201fe7c868536dcb3e2d /LOGGING_template.toml | |
| parent | ad2914284e8ef5f59c410018415dbb8d574586f8 (diff) | |
Kgn/logging revamp (#2720)
* update config files
* rebase after electron remove
* added toml to requirements
* logging update
* Unified use of the TOML format instead of INI [no ci]
* Unified use of the TOML format instead of INI [no ci]
* moving debug*.py to debug dir, moving some part for debugger [no ci]
* use of alternate logging in some cases
* updated debug logger [no ci]
* logging update
* updated notes
* updated notes about logging
* style check
Diffstat (limited to 'LOGGING_template.toml')
| -rw-r--r-- | LOGGING_template.toml | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/LOGGING_template.toml b/LOGGING_template.toml new file mode 100644 index 00000000..3c90cf58 --- /dev/null +++ b/LOGGING_template.toml @@ -0,0 +1,69 @@ +### customize this file and save as LOGGING.toml +### logging/warning template for inkstitch +### format: toml +### enable config file in DEBUG.toml: log_config_file + +### warnings.simplefilter(action), default: "default" +### - possible values: "error", "ignore", "always", "default", "module", "once" +warnings_action = "default" + +### logging.captureWarnings() default: true +### - possible values: true, false +warnings_capture = true + +### mandatory, must be an integer and 1 +version = 1 + +### disable loggers activated before the configuration is loaded +disable_existing_loggers = false + +### define the loggers, handlers, formatters, filters +[filters] + +[formatters.simple] + format = "%(asctime)s [%(levelname)s]: %(filename)s.%(funcName)s: %(message)s" + +[formatters.debug] + format = "%(asctime)s %(message)s" + + +[handlers.file_inkstitch] + class = "logging.FileHandler" + formatter = "simple" + filename = "%(SCRIPTDIR)s/logs/inkstitch.log" + mode = "w" + +[handlers.file_inkstitch_debug] + class = "logging.FileHandler" + formatter = "debug" + filename = "%(SCRIPTDIR)s/logs/inkstitch_debug.log" + mode = "w" + +[handlers.file_root] + class = "logging.FileHandler" + formatter = "simple" + filename = "%(SCRIPTDIR)s/logs/inkstitch_root.log" + mode = "w" + + +### used for: logger = logging.getLogger("inkstitch") +### logger = logging.getLogger("inkstitch.xxx") where xxx is not specified in this config file +### - highest level logger for all 'inkstitch.*' loggers +[loggers.inkstitch] + level = "DEBUG" + handlers = [ "file_inkstitch",] + propagate = false + +### used for: logger = logging.getLogger("inkstitch.debug") +### - use quotes for the logger name with dots, otherwise it will be treated as a table subsection +### - [loggers.inkstitch.debug] is not the same as [loggers.'inkstitch.debug'] +[loggers.'inkstitch.debug'] + level = "DEBUG" # to enable the logger, seems to be the default + # level = "CRITICAL" # to disable the logger + handlers = [ "file_inkstitch_debug",] + propagate = false + +### root - loggers not specified in this config file will be managed by this logger +[loggers.root] + level = "DEBUG" + handlers = [ "file_root",] |
