Add colours to logging

Signed-off-by: András Schmelczer <andras@schmelczer.dev>
This commit is contained in:
Andras Schmelczer 2022-04-10 09:41:04 +02:00
commit 3730a884b0

View file

@ -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