afnio.logging_config
afnio.logging_config.configure_logging(verbosity='info')
Configure logging for the afnio library.
Sets up logging format and levels for CLI, scripts, and Jupyter notebooks. In a notebook, adds a custom handler for INFO-level logs to display user-facing messages with color and formatting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
verbosity
|
str
|
Logging level as a string ( |
'info'
|
Source code in afnio/logging_config.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | |
afnio.logging_config.set_logger_level(logger_name, level)
Context manager to temporarily set the logging level for a logger.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logger_name
|
str
|
Name of the logger to set the level for. |
required |
level
|
int
|
Logging level to set (e.g., logging.DEBUG, logging.INFO). |
required |
Examples:
>>> with set_logger_level("afnio.tellurio.run", logging.WARNING):
>>> # code that should log only WARNING and above
Source code in afnio/logging_config.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |