Skip to content

Commit 7e8a8fd

Browse files
authored
Merge pull request #95 from braboj/codex/add-headings-to-logging-examples
Add heading separators for logging examples
2 parents 8c1fd23 + 0693e7a commit 7e8a8fd

9 files changed

Lines changed: 30 additions & 8 deletions

examples/13_logging/logging_advanced_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Example: Basic and Advanced Logging Configuration
1+
# Advanced Logging Configuration
2+
# --------------------------------------------------------------------------------
3+
# Demonstrates custom handlers, a formatter, and propagation control.
24

35
import logging
46

examples/13_logging/logging_basic_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Example: Basic and Advanced Logging Configuration
1+
# Basic Logging Configuration
2+
# --------------------------------------------------------------------------------
3+
# Uses basicConfig for the root logger and a named child logger.
24

35
import logging
46

examples/13_logging/logging_config_dict.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Example: Logging Configuration with a Dictionary
1+
# Logging Configuration with a Dictionary
2+
# --------------------------------------------------------------------------------
3+
# Uses a dict to define formatters, handlers and loggers.
24

35
import logging.config
46

examples/13_logging/logging_config_file.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Example: Configure the logging module with a configuration file
1+
# Configuring Logging from a File
2+
# --------------------------------------------------------------------------------
3+
# Loads logger settings from an external configuration file.
24

35
import logging.config
46

examples/13_logging/logging_exceptions.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Logging Exceptions
2+
# --------------------------------------------------------------------------------
3+
# Captures an exception and logs the full stack trace.
4+
15
import logging
26

37
a = 5

examples/13_logging/logging_formatter.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Example: Basic and Advanced Logging Configuration
1+
# Custom Logging Formatter
2+
# --------------------------------------------------------------------------------
3+
# Configures a formatter for a named logger.
24

35
import logging
46

examples/13_logging/logging_handlers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Multiple Logging Handlers
2+
# --------------------------------------------------------------------------------
3+
# Sets up stream, file and timed rotating handlers.
4+
15
import logging.handlers
26
import time
37

examples/13_logging/logging_hierarchy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Example: Logging Objects with hierarchy
1+
# Logger Hierarchy
2+
# --------------------------------------------------------------------------------
3+
# Shows parent, child and grandchild loggers working together.
24

35
import logging
46

examples/13_logging/logging_levels.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# Example: Logging Levels
1+
# Logging Levels
2+
# --------------------------------------------------------------------------------
3+
# Demonstrates how to emit messages for each severity level.
24

35
import logging
46

@@ -10,4 +12,4 @@
1012
logging.info('Hello world!')
1113
logging.warning('Hello world!')
1214
logging.error('Hello world!')
13-
logging.critical('Hello world!')
15+
logging.critical('Hello world!')

0 commit comments

Comments
 (0)