Core
provide.foundation.logger.core
¶
TODO: Add module docstring.
Attributes¶
Classes¶
FoundationLogger
¶
A structlog-based logger providing a standardized logging interface.
Source code in provide/foundation/logger/core.py
Functions¶
__setattr__
¶
Override setattr to prevent accidental modification of logger state.
Source code in provide/foundation/logger/core.py
bind
¶
Create a new logger with additional context bound to it.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**kwargs
|
Any
|
Key-value pairs to bind to the logger |
{}
|
Returns:
| Type | Description |
|---|---|
Any
|
A new logger instance with the bound context |
Source code in provide/foundation/logger/core.py
critical
¶
Log critical-level event.
debug
¶
error
¶
exception
¶
Log error-level event with exception traceback.
Source code in provide/foundation/logger/core.py
info
¶
setup
¶
Setup the logger with configuration from Hub.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
TelemetryConfig
|
TelemetryConfig to use for setup |
required |
Source code in provide/foundation/logger/core.py
trace
¶
Log trace-level event for detailed debugging.
Source code in provide/foundation/logger/core.py
try_unbind
¶
Create a new logger with specified keys removed from context. Does not raise an error if keys don't exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*keys
|
str
|
Context keys to remove |
()
|
Returns:
| Type | Description |
|---|---|
Any
|
A new logger instance without the specified keys |
Source code in provide/foundation/logger/core.py
unbind
¶
Create a new logger with specified keys removed from context.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*keys
|
str
|
Context keys to remove |
()
|
Returns:
| Type | Description |
|---|---|
Any
|
A new logger instance without the specified keys |
Source code in provide/foundation/logger/core.py
warning
¶
Log warning-level event.
GlobalLoggerProxy
¶
Proxy object that forwards all attribute access to Hub-based logger.
Functions¶
__setattr__
¶
Allow tests to set internal state on the underlying logger.
Source code in provide/foundation/logger/core.py
Functions¶
get_global_logger
¶
Get the global FoundationLogger instance through Hub.
This function acts as the Composition Root for the global logger instance, maintained for backward compatibility.
Note: For building testable and maintainable applications, the recommended
approach is to inject a logger instance via a Container. This global
accessor should be avoided in new application code.
Returns:
| Type | Description |
|---|---|
FoundationLogger
|
FoundationLogger instance from Hub |