fix(logging): remove duplicate terminal output by disabling logger propagation

This commit is contained in:
2025-12-19 22:56:45 +01:00
parent 17bc3fad03
commit d37707941c
2 changed files with 1234 additions and 1 deletions

View File

@ -17,8 +17,10 @@ sys.path.append(project_root)
try:
from logging_utils import setup_logging
except ImportError:
logging.basicConfig(level=logging.INFO)
setup_logging = None
# Ensure root logger is clean if we can't use setup_logging
logging.getLogger().handlers.clear()
logging.basicConfig(level=logging.INFO)
from eth_account import Account
from hyperliquid.exchange import Exchange
@ -43,6 +45,7 @@ class UnixMsLogFilter(logging.Filter):
# Configure Logging
logger = logging.getLogger("SCALPER_HEDGER")
logger.setLevel(logging.INFO)
logger.propagate = False # Prevent double logging from root logger
logger.handlers.clear() # Clear existing handlers to prevent duplicates
# Console Handler

1230
clp_scalper_hedger.py Normal file

File diff suppressed because it is too large Load Diff