Factories
π€ AI-Generated Content
This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.
provide.foundation.logger.factories
¶
Functions¶
get_logger
¶
Get a logger instance through Hub with circular import protection.
This function provides access to the global logger instance. It is preserved for backward compatibility but should be avoided in new application code in favor of explicit Dependency Injection.
Circular Import Protection
Uses thread-local state to detect recursive initialization and falls back to basic structlog when circular dependencies are detected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str | None
|
Logger name (e.g., name from a module) |
None
|
Returns:
| Type | Description |
|---|---|
Any
|
Configured structlog logger instance |
Note
For building testable and maintainable applications, the recommended
approach is to inject a logger instance via a Container. See the
Dependency Injection guide for more information.