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

Undocumented

Method __init__ Initialize the advanced rotating file handler.
Method _cleanupOldFiles Remove old log files exceeding the backup count.
Method _compressFile Compress the specified file using gzip.
Method _ensureStream Ensure the stream is available and up to date.
Method _resolvePath Resolve the full path by replacing the {suffix} placeholder.
Method _rotateFile Rotate the current log file if needed.
Method _shouldRotate Determine whether the log file should be rotated.
Method close Close the handler and release resources.
Method emit Emit a log record.
Instance Variable _cache_monotonic_expiry Undocumented
Instance Variable _cleanup_pattern Undocumented
Instance Variable _lock Undocumented
Instance Variable _path_cache Undocumented
Instance Variable app_root Undocumented
Instance Variable backup_count Undocumented
Instance Variable compress_rotated Undocumented
Instance Variable current_path Undocumented
Instance Variable current_suffix Undocumented
Instance Variable delay Undocumented
Instance Variable encoding Undocumented
Instance Variable file_size Undocumented
Instance Variable max_bytes Undocumented
Instance Variable path_template Undocumented
Instance Variable stream Undocumented
Instance Variable suffix_resolver Undocumented
def __init__(self, path_template: str, suffix_resolver: SuffixResolver, max_bytes: int | None = None, backup_count: int = 5, encoding: str = 'utf-8', *, delay: bool = True, compress_rotated: bool = False, app_root: str = '.'): (source)

Initialize the advanced rotating file handler.

Parameters
path_template:strPath template containing the {suffix} placeholder.
suffix_resolver:SuffixResolverResolver for determining the suffix for rotation.
max_bytes:int | None, optionalMaximum file size in bytes before rotation (for chunked rotation).
backup_count:int, optionalMaximum number of backup files to retain.
encoding:str, optionalFile encoding.
delay:bool, optionalIf True, delay file opening until the first log record.
compress_rotated:bool, optionalIf True, compress rotated files using gzip.
app_root:str, optionalApplication root directory.
Returns
NoneThis method does not return a value.
def _cleanupOldFiles(self): (source)

Remove old log files exceeding the backup count.

This method deletes log files that exceed the configured backup count, including compressed versions if present.

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

Compress the specified file using gzip.

Parameters
file_path:strPath to the file to compress.
Returns
NoneThis method does not return a value.
def _ensureStream(self): (source)

Ensure the stream is available and up to date.

Checks if log rotation is needed and opens a new stream if required. Updates the current suffix and file size accordingly.

Returns
NoneThis method does not return a value.
def _resolvePath(self, suffix: str) -> str: (source)

Resolve the full path by replacing the {suffix} placeholder.

Parameters
suffix:strSuffix to use for replacing {suffix}.
Returns
strThe fully resolved file path as a string.
def _rotateFile(self): (source)

Rotate the current log file if needed.

This method closes the current stream, compresses the rotated file if enabled, cleans up old log files, and resets the handler's state.

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

Determine whether the log file should be rotated.

Parameters
current_suffix:strThe suffix already resolved by the caller, avoiding a redundant getSuffix() call (C1).
Returns
boolTrue if the file should be rotated, otherwise False.
def close(self): (source)

Close the handler and release resources.

Closes the underlying stream if open and releases any resources held by the handler. Ensures thread safety during the close operation.

Returns
NoneThis method does not return a value.
def emit(self, record: LogRecord): (source)

Emit a log record.

Parameters
record:LogRecordThe log record to emit.
Returns
NoneThis method does not return a value.
_cache_monotonic_expiry: float = (source)

Undocumented

_cleanup_pattern: re.Pattern = (source)

Undocumented

Undocumented

_path_cache: dict[str, str] = (source)

Undocumented

app_root = (source)

Undocumented

backup_count = (source)

Undocumented

compress_rotated = (source)

Undocumented

current_path = (source)

Undocumented

current_suffix = (source)

Undocumented

Undocumented

encoding = (source)

Undocumented

file_size = (source)

Undocumented

max_bytes = (source)

Undocumented

path_template = (source)

Undocumented

Undocumented

suffix_resolver = (source)

Undocumented