mirror of https://github.com/kortix-ai/suna.git
Migrate to modern datetime library API
Signed-off-by: Emmanuel Ferdman <emmanuelferdman@gmail.com>
This commit is contained in:
parent
aaadab5140
commit
e2d9922dd1
|
@ -12,7 +12,7 @@ import logging
|
|||
import json
|
||||
import sys
|
||||
import os
|
||||
from datetime import datetime
|
||||
from datetime import datetime, timezone
|
||||
from contextvars import ContextVar
|
||||
from functools import wraps
|
||||
import traceback
|
||||
|
@ -29,7 +29,7 @@ class JSONFormatter(logging.Formatter):
|
|||
def format(self, record: logging.LogRecord) -> str:
|
||||
"""Format log record as JSON with contextual information."""
|
||||
log_data = {
|
||||
'timestamp': datetime.utcnow().isoformat(),
|
||||
'timestamp': datetime.now(timezone.utc).replace(tzinfo=None).isoformat(),
|
||||
'level': record.levelname,
|
||||
'message': record.getMessage(),
|
||||
'module': record.module,
|
||||
|
|
Loading…
Reference in New Issue