logging_utils¶
logging_utils ¶
Structured logging utilities.
Provides consistent logging configuration across the SDK using structlog.
configure_logging ¶
configure_logging(level: str = 'INFO', json_format: bool = False, include_timestamp: bool = True) -> None
Configure structured logging for the SDK.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level
|
str
|
Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) |
'INFO'
|
json_format
|
bool
|
Use JSON output format |
False
|
include_timestamp
|
bool
|
Include timestamps in logs |
True
|
Source code in ondine/utils/logging_utils.py
get_logger ¶
Get a structured logger instance.
Auto-configures logging on first use if not already configured.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Logger name (typically name) |
required |
Returns:
| Type | Description |
|---|---|
BoundLogger
|
Configured structlog logger |
Source code in ondine/utils/logging_utils.py
sanitize_for_logging ¶
Sanitize sensitive data for logging.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any]
|
Dictionary potentially containing sensitive data |
required |
Returns:
| Type | Description |
|---|---|
dict[str, Any]
|
Sanitized dictionary |