Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

2.0 KB
Raw Blame

_configure_library_logging

def _configure_library_logging():

set_log_file

def set_log_file(file_path):

Set a file handler for the CAMEL library logging.

Parameters:

  • file_path (str): Path to the log file. If the directory doesn't exist, it will be created.

Returns:

logging.FileHandler: The file handler that was added to the logger.

disable_logging

def disable_logging():

Disable all logging for the CAMEL library.

This function sets the log level to a value higher than CRITICAL, effectively disabling all log messages, and adds a NullHandler to suppress any potential warnings about no handlers being found.

enable_logging

def enable_logging():

Enable logging for the CAMEL library.

This function re-enables logging if it was previously disabled, and configures the library logging using the default settings. If the logging is already configured, this function does not change its configuration.

set_log_level

def set_log_level(level):

Set the logging level for the CAMEL library.

Parameters:

Raises:

  • ValueError: If the provided level is not a valid logging level.

get_logger

def get_logger(name: str):

Get a logger with the specified name, prefixed with 'camel.'.

Parameters:

  • name (str): The name to be appended to 'camel.' to create the logger.

Returns:

logging.Logger: A logger instance with the name 'camel.{name}'.