Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Dev2Forge/chromologger/llms.txt
Use this file to discover all available pages before exploring further.
FileManager is an internal static utility class in chromologger.utils.files_manager that handles all file and path operations used by the Logger. It is not part of the public __all__ export but may be useful for advanced use cases.
Import
FileManager is an internal utility. The Logger class is the recommended public API for all logging operations — use FileManager directly only when you need low-level file or path helpers outside of normal logging workflows.Methods
All methods onFileManager are @staticmethod — no instantiation is required.
open_file(file_relative_path, mode='a', encoding='utf-8')
file_relative_path to an absolute path via get_abs_path(), then opens the file with Python’s built-in open().
Path to the target file. May be relative or absolute — it is always resolved to absolute internally before opening.
File open mode passed directly to
open(). Defaults to append mode ('a'), matching the typical use-case of appending log lines.Character encoding passed to
open(). Defaults to UTF-8.The open file object on success. Any exception raised during
open() is re-raised to the caller — the method does not swallow errors silently. In practice, None is never returned because any failure path raises rather than returning.write_plain_text_file(file_path, message)
file_path via open_file() in append mode, writes str(message) to it, then closes the file. Used internally by Logger.__log() to write entries to the module’s own internal error log.
Path to the file to write to. Resolved to absolute by the underlying
open_file() call.The content to write. Converted to
str via str(message) before writing, so any Python object may be passed.Any exception raised during file opening or writing is re-raised to the caller. Unlike
Logger.log(), this method does not apply a timestamp or log-level prefix — the caller is responsible for formatting the string.get_abs_path(relative_path)
relative_path as a string, using pathlib.Path(relative_path).resolve().absolute().
The path to resolve. Relative paths are resolved against the current working directory; absolute paths pass through unchanged.
The absolute, resolved path string (no trailing separator, symlinks resolved).
get_abs_dir(relative_path)
relative_path. Internally calls pathlib.Path(relative_path).resolve().absolute().parent.
Used by Logger.__init__() to determine self.caller_script — the directory of the script that created the logger.
A path to any file or directory. The method resolves it and returns the parent directory, not the path itself.
Absolute path of the parent directory as a string.
join_paths(base_path, *others_paths)
base_path with one or more additional path components using pathlib.Path.joinpath(), then resolves the combined path to an absolute string.
The root portion of the path. Resolved to absolute before joining.
One or more path components to append to
base_path. Passed directly to pathlib.Path.joinpath().The fully resolved, absolute joined path as a string.