Fix code quaity issues

This commit is contained in:
amcmanu3 2024-04-20 17:04:30 -04:00
parent 2134c4226d
commit d998d82de0
2 changed files with 5 additions and 7 deletions

View File

@ -18,8 +18,8 @@ class JsonEncoderDatetime(JsonEncoderStrFallback):
def default(self, o):
if isinstance(o, datetime):
return o.strftime("%Y-%m-%dT%H:%M:%S%z")
else:
return super().default(o)
return super().default(o)
class JsonFormatter(logging.Formatter):
@ -31,10 +31,9 @@ class JsonFormatter(logging.Formatter):
if datefmt:
# Use the specified date format
return timestamp.strftime(datefmt)
else:
# Default date format: YYYY-MM-DD HH:MM:SS,mmm
secs = int(record.msecs)
return f"{timestamp.strftime('%Y-%m-%d %H:%M:%S')},{secs:03d}"
# Default date format: YYYY-MM-DD HH:MM:SS,mmm
secs = int(record.msecs)
return f"{timestamp.strftime('%Y-%m-%d %H:%M:%S')},{secs:03d}"
def format(self, record):
log_data = {

View File

@ -16,7 +16,6 @@ from app.classes.models.base_model import BaseModel
from app.classes.models.users import HelperUsers
from app.classes.models.servers import Servers
from app.classes.models.server_permissions import PermissionsServers
from app.classes.shared.main_models import DatabaseShortcuts
from app.classes.shared.websocket_manager import WebSocketManager
logger = logging.getLogger(__name__)