Skip to content
Eyal Tuzon edited this page Nov 10, 2022 · 18 revisions

NRT-Logging

Hierarchical logging help to group logs that are related to the same code flow.

Log style can be styled in Yaml format or in Line format.

Example of output in LINE format

- log: 2022-10-21 21:30:16.361425 [INFO] [manual_hierarchy_line_logging.py.<module>:13] main level log
  children:
    - log: 2022-10-21 21:30:16.367386 [INFO] [manual_hierarchy_line_logging.py.<module>:15] child 1
      children:
        - log: 2022-10-21 21:30:16.373975 [INFO] [manual_hierarchy_line_logging.py.<module>:17] child 1_1
    - log: 2022-10-21 21:30:16.380979 [INFO] [manual_hierarchy_line_logging.py.<module>:19] child 2
- log: 2022-10-21 21:30:16.387013 [INFO] [manual_hierarchy_line_logging.py.<module>:21] continue main level

Example of output in YAML format

---
date: 2022-10-21 21:20:49.658272
log_level: WARN
path: demo_classes.py.A
method: a1
line_number: 32
message: Message 1
children:
  - date: 2022-10-21 21:20:49.666366
    log_level: INFO
    path: demo_classes.py.Child
    method: child_1
    line_number: 16
    message: Child 1
    children:
      - date: 2022-10-21 21:20:49.675316
        log_level: INFO
        path: demo_classes.py.Child
        method: child_2
        line_number: 20
        message: Child 2

Automatic hierarchy and manual hierarchy are supported.

  • Automatic hierarchy: Logs hierarchy is determined by the level of the method in the Stack Trace
  • Manual hierarchy: Logs in the same methods hierarchy are determined by the user

Installation
Examples

logger_manager
Logger
Stream Handler
Configuration file
Release Notes

Clone this wiki locally