Skip to content

Commit

Permalink
fix: failing linter
Browse files Browse the repository at this point in the history
  • Loading branch information
wwills2 committed Dec 11, 2024
1 parent d3e3e20 commit 5e326f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/api/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import enum
import logging
from contextlib import asynccontextmanager
from contextlib import AbstractAsyncContextManager, asynccontextmanager
from pathlib import Path
from typing import AsyncGenerator, AsyncIterator
Expand Down
3 changes: 1 addition & 2 deletions app/api/v1/cron.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import asyncio
import json
from typing import List, Optional
import logging
from typing import List
from typing import List, Optional

from chia.consensus.block_record import BlockRecord
from chia.rpc.full_node_rpc_client import FullNodeRpcClient
Expand Down
8 changes: 6 additions & 2 deletions app/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@
# Define the log format with version
log_format = f"%(asctime)s,%(msecs)d {version} %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s"


def get_file_log_handler(formatter: logging.Formatter) -> ConcurrentRotatingFileHandler:
log_path = settings.LOG_PATH
log_path.parent.mkdir(parents=True, exist_ok=True)
handler = ConcurrentRotatingFileHandler(str(log_path.resolve()), "a", maxBytes=50 * 1024 * 1024, backupCount=7, use_gzip=False)
handler = ConcurrentRotatingFileHandler(
str(log_path.resolve()), "a", maxBytes=50 * 1024 * 1024, backupCount=7, use_gzip=False
)
handler.setFormatter(formatter)
return handler


def initialize_logging() -> Dict[str, Any]:
log_date_format = "%Y-%m-%dT%H:%M:%S"
file_log_formatter = logging.Formatter(
Expand Down Expand Up @@ -54,4 +58,4 @@ def initialize_logging() -> Dict[str, Any]:
"datefmt": "%Y-%m-%d:%H:%M:%S",
}
)
return log_config # type: ignore
return log_config # type: ignore

0 comments on commit 5e326f3

Please sign in to comment.