Add colours to logging
Signed-off-by: András Schmelczer <andras@schmelczer.dev>
This commit is contained in:
parent
85a06096bf
commit
3730a884b0
1 changed files with 84 additions and 268 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import logging
|
||||
import threading
|
||||
from collections import defaultdict
|
||||
from datetime import datetime
|
||||
|
|
@ -8,8 +7,6 @@ from typing import Any, DefaultDict, Dict, List, Optional, Type
|
|||
from ..context import get_context
|
||||
from ..views import Model, Trace
|
||||
|
||||
logger = logging.getLogger("good_ai")
|
||||
|
||||
|
||||
class TracingContext:
|
||||
_contexts: DefaultDict[int, List["TracingContext"]] = defaultdict(lambda: [])
|
||||
|
|
@ -64,6 +61,6 @@ class TracingContext:
|
|||
assert self._trace is not None
|
||||
get_context().persistence.save_document(self._trace)
|
||||
else:
|
||||
logger.exception(f"Could not finish operation: {exception}")
|
||||
get_context().logger.exception(f"Could not finish operation: {exception}")
|
||||
|
||||
return True
|
||||
|
|
|
|||
Loading…
Reference in a new issue