mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix code quaity issues
This commit is contained in:
parent
2134c4226d
commit
d998d82de0
@ -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 = {
|
||||
|
@ -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__)
|
||||
|
Loading…
Reference in New Issue
Block a user