ORIONIS API REFERENCE

THE ORIONIS API

Build with clarity.

Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.

class documentation

class Logger(ILogger): (source)

Constructor: Logger(app)

View In Hierarchy

Undocumented

Method __createChannelHandler Create a handler for a specific channel.
Method __createFormatter Create and return an optimized log formatter with caching.
Method __del__ Release resources when the logger is destroyed.
Method __ensureLoggerReady Ensure the logger is initialized and ready for use with ultra-fast lazy init.
Method __init__ Initialize the Logger instance with ultra-fast optimization.
Method __initializeLogger Build the standard library logger for the default channel.
Method __normalizeChannelConfig Normalize the channel configuration for logging.
Method close Close all handlers and release logger resources.
Method critical Log a critical message.
Method debug Log a debug message.
Method error Log an error message.
Method getActiveChannel Return the name of the currently active logging channel.
Method getActiveChannels Return the names of active logging channels.
Method getAvailableChannels Return all available logging channels from configuration.
Method getLogger Return the internal logger instance for advanced usage.
Method info Log an informational message.
Method reloadConfiguration Reload the logger configuration from the application.
Method switchChannel Switch to a different logging channel.
Method warning Log a warning message.
Class Variable _formatter_cache Undocumented
Class Variable name Return the name of the logger service.
Instance Variable __app Undocumented
Instance Variable __config Undocumented
Instance Variable __date_format Undocumented
Instance Variable __default_level Undocumented
Instance Variable __handlers_cache Undocumented
Instance Variable __init_lock Undocumented
Instance Variable __log_format Undocumented
Instance Variable __logger Undocumented
Instance Variable __logger_name Undocumented
def __createChannelHandler(self, channel_name: str, channel_config: dict, app_root: str) -> logging.Handler | None: (source)

Create a handler for a specific channel.

Parameters
channel_name:strThe name of the channel.
channel_config:dictThe configuration dictionary for the channel.
app_root:strThe root path of the application.
Returns
logging.Handler | NoneThe configured handler instance, or None if creation fails.
def __createFormatter(self) -> logging.Formatter: (source)

Create and return an optimized log formatter with caching.

Returns
logging.FormatterThe configured formatter instance for log messages.
def __del__(self): (source)

Release resources when the logger is destroyed.

Calls the close method to ensure all handlers and resources are properly released when the logger instance is garbage collected.

Returns
NoneThis method does not return a value.
def __ensureLoggerReady(self): (source)

Ensure the logger is initialized and ready for use with ultra-fast lazy init.

Uses optimized double-checked locking for maximum performance.

Returns
NoneThis method does not return a value.
Raises
RuntimeErrorIf the logger cannot be initialized.
def __init__(self, app: IApplication): (source)

Initialize the Logger instance with ultra-fast optimization.

Parameters
app:IApplicationApplication instance providing configuration.
Returns
NoneThis method does not return a value.
def __initializeLogger(self): (source)

Build the standard library logger for the default channel.

Configure the shared logger, create the handler declared by the default channel and cache it. Fall back to a basic file handler when the default channel is not present in the configuration.

Returns
NoneThis method does not return a value.
Raises
RuntimeErrorIf the logger cannot be initialized.
def __normalizeChannelConfig(self, config: dict) -> dict: (source)

Normalize the channel configuration for logging.

Parameters
config:dictOriginal channel configuration.
Returns
dictNormalized channel configuration with ensured defaults.
def close(self): (source)

Close all handlers and release logger resources.

This method should be called when the logger is no longer needed to ensure that all file handles and resources are properly released.

Returns
NoneThis method does not return a value.
def critical(self, message: str): (source)

Log a critical message.

Parameters
message:strCritical message to log.
Returns
NoneThis method does not return a value.
def debug(self, message: str): (source)

Log a debug message.

Parameters
message:strDebug message to log.
Returns
NoneThis method does not return a value.
def error(self, message: str): (source)

Log an error message.

Parameters
message:strError message to log.
Returns
NoneThis method does not return a value.
def getActiveChannel(self) -> str | None: (source)

Return the name of the currently active logging channel.

Returns
str | NoneThe name of the active channel, or None if no channel is active.
def getActiveChannels(self) -> list[str]: (source)

Return the names of active logging channels.

Returns
list[str]List containing the names of active logging channels.
def getAvailableChannels(self) -> list[str]: (source)

Return all available logging channels from configuration.

Returns
list[str]List of all configured channel names.
def getLogger(self) -> logging.Logger: (source)

Return the internal logger instance for advanced usage.

Returns
logging.LoggerThe configured logger instance.
Raises
RuntimeErrorIf the logger is not available.
def info(self, message: str): (source)

Log an informational message.

Parameters
message:strThe message to log.
Returns
NoneThis method does not return a value.
def reloadConfiguration(self): (source)

Reload the logger configuration from the application.

This method allows dynamic reloading of logger settings without restarting the application.

Returns
NoneThis method does not return a value.
def switchChannel(self, channel_name: str) -> bool: (source)

Switch to a different logging channel.

Initialize the logger when needed, close current handlers, clear caches, and create a new handler for the specified channel. Only one channel is active at a time.

Parameters
channel_name:strName of the channel to switch to.
Returns
boolTrue if the switch was successful, False otherwise.
def warning(self, message: str): (source)

Log a warning message.

Parameters
message:strWarning message to log.
Returns
NoneThis method does not return a value.

Undocumented

name: ClassVar[str] = (source)

Return the name of the logger service.

Returns
strThe name of the logger service.
__app: IApplication = (source)

Undocumented

__config: dict = (source)

Undocumented

__date_format: str = (source)

Undocumented

__default_level: int = (source)

Undocumented

__handlers_cache: dict[str, logging.Handler] = (source)

Undocumented

__init_lock = (source)

Undocumented

__log_format: str = (source)

Undocumented

Undocumented

__logger_name: str = (source)

Undocumented