Robert Brennan fadcdc117e
Migrate to new folder structure in preparation for refactor (#1531)
* fix up folder structure

* update docs

* fix imports

* fix imports

* fix imoprt

* fix imports

* fix imports

* fix imports

* fix test import

* fix tests

* fix main import
2024-05-02 17:01:54 +00:00

1.5 KiB

sidebar_label, title
sidebar_label title
logger opendevin.core.logger

get_console_handler

def get_console_handler()

Returns a console handler for logging.

get_file_handler

def get_file_handler()

Returns a file handler for logging.

log_uncaught_exceptions

def log_uncaught_exceptions(ex_cls, ex, tb)

Logs uncaught exceptions along with the traceback.

Arguments:

  • ex_cls type - The type of the exception.
  • ex Exception - The exception instance.
  • tb traceback - The traceback object.

Returns:

None

LlmFileHandler Objects

class LlmFileHandler(logging.FileHandler)

LLM prompt and response logging

__init__

def __init__(filename, mode='a', encoding='utf-8', delay=False)

Initializes an instance of LlmFileHandler.

Arguments:

  • filename str - The name of the log file.
  • mode str, optional - The file mode. Defaults to 'a'.
  • encoding str, optional - The file encoding. Defaults to None.
  • delay bool, optional - Whether to delay file opening. Defaults to False.

emit

def emit(record)

Emits a log record.

Arguments:

  • record logging.LogRecord - The log record to emit.

get_llm_prompt_file_handler

def get_llm_prompt_file_handler()

Returns a file handler for LLM prompt logging.

get_llm_response_file_handler

def get_llm_response_file_handler()

Returns a file handler for LLM response logging.