The Logger class provides logging capabilities for CyborgDB operations.

Configure Logger

def configure(self,
              level: str,
              to_file: bool = False,
              file_path: str = None)

Configures the logger with the specified log level and output options.

Parameters

ParameterTypeDefaultDescription
levelstr-Log level. Must be one of: “debug”, “info”, “warning”, “error”, “critical”.
to_fileboolFalseWhether to write logs to a file instead of stdout/stderr.
file_pathstr"cyborgdb_client.log"(Optional) Path to the log file. Only used when to_file is True.

Exceptions

Example Usage

# Get the logger instance
logger = cyborgdb.Logger.instance()

# Configure logger to write INFO level logs to console
logger.configure(level="info")

# Configure logger to write ERROR level logs to a file
logger.configure(level="error", to_file=True, file_path="/path/to/logs/cyborgdb.log")
The DEBUG level is only available in debug builds of the library.