summaryrefslogtreecommitdiff
path: root/LOGGING_template.toml
blob: 3c90cf584e648f9088d14df230e4e189716beb06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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",]