Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit 1e172e6

Browse files
Silencing SQLAlchemy logs
1 parent 1660500 commit 1e172e6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/codegate/codegate_logging.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,9 @@ def setup_logging(
132132
root_logger.addHandler(stdout_handler)
133133
root_logger.addHandler(stderr_handler)
134134

135+
# Set explicitly the log level for other modules
136+
logging.getLogger("sqlalchemy").setLevel(logging.WARNING)
137+
135138
# Create a logger for our package
136139
logger = structlog.get_logger("codegate")
137140
logger.debug(

src/codegate/db/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(self, sqlite_path: Optional[str] = None):
3030
logger.debug(f"Initializing DB from path: {self._db_path}")
3131
engine_dict = {
3232
"url": f"sqlite+aiosqlite:///{self._db_path}",
33-
"echo": True, # Set to False in production
33+
"echo": False, # Set to False in production
3434
"isolation_level": "AUTOCOMMIT", # Required for SQLite
3535
}
3636
self._async_db_engine = create_async_engine(**engine_dict)

0 commit comments

Comments
 (0)