Skip to content

Commit 31b44f7

Browse files
committed
log messages on ERROR level in task agent to console
1 parent 67aa591 commit 31b44f7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
log_file_handler.setFormatter(logging.Formatter('%(asctime)s - %(levelname)s - %(message)s'))
4545
logging.getLogger('').addHandler(log_file_handler)
4646

47+
console_handler = logging.StreamHandler()
48+
console_handler.setLevel(logging.ERROR) # log only ERROR and above to console
49+
console_handler.setFormatter(logging.Formatter('%(levelname)s: %(message)s'))
50+
logging.getLogger('').addHandler(console_handler)
51+
4752
DEFAULT_MAX_TURNS = 50
4853
RATE_LIMIT_BACKOFF = 5
4954
MAX_RATE_LIMIT_BACKOFF = 120

0 commit comments

Comments
 (0)