Skip to content

Commit

Permalink
use .getLogger to avoid same logging message to get printed twice
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyaoww committed Apr 7, 2024
1 parent 99a8dc4 commit 27eca8a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions opendevin/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,14 @@ def log_uncaught_exceptions(ex_cls, ex, tb):

sys.excepthook = log_uncaught_exceptions

opendevin_logger = logging.getLogger()
opendevin_logger = logging.getLogger("opendevin")
opendevin_logger.setLevel(logging.INFO)
opendevin_logger.propagate = False
opendevin_logger.addHandler(get_console_handler())
opendevin_logger.addHandler(get_file_handler())
opendevin_logger.propagate = False
opendevin_logger.debug('Logging initialized')
opendevin_logger.debug('Logging to %s', os.path.join(
os.getcwd(), 'logs', 'opendevin.log'))
opendevin_logger.name = 'opendevin'

# Exclude "litellm" from logging output
logging.getLogger('LiteLLM').disabled = True
Expand Down

0 comments on commit 27eca8a

Please sign in to comment.