Skip to content

Commit

Permalink
tests: fix unit test logging configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
azmeuk committed Jan 13, 2025
1 parent 3313224 commit 68fc2f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion canaille/core/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class CoreSettings(BaseModel):
[CANAILLE.LOGGING]
version = 1
formatters.default.format = "[%(asctime)s] %(levelname)s in %(module)s: %(message)s"
formatters.default.format = "[%(asctime)s] - $(ip)s - %(levelname)s in %(module)s: %(message)s"
root = {level = "INFO", handlers = ["canaille"]}
[CANAILLE.LOGGING.handlers.canaille]
Expand Down
4 changes: 2 additions & 2 deletions tests/app/test_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def test_silent_custom_logger(testclient, caplog, tmp_path, configuration, backe
"version": 1,
"formatters": {
"default": {
"format": "[%(asctime)s] %(levelname)s in %(module)s: %(message)s",
"format": "[%(asctime)s] - %(ip)s - %(levelname)s in %(module)s: %(message)s",
}
},
"handlers": {
Expand All @@ -141,9 +141,9 @@ def test_silent_custom_logger(testclient, caplog, tmp_path, configuration, backe
"formatter": "default",
}
},
"root": {"level": "FOOBAZ", "handlers": ["wsgi"]},
"loggers": {
"faker": {"level": "FOOBAZ"},
"canaille": {"level": "FOOBAZ", "handlers": ["wsgi"]},
},
"disable_existing_loggers": False,
}
Expand Down
4 changes: 2 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def configuration(smtpd):
"version": 1,
"formatters": {
"default": {
"format": "[%(asctime)s] %(levelname)s in %(module)s: %(message)s",
"format": "[%(asctime)s] - %(ip)s - %(levelname)s in %(module)s: %(message)s",
}
},
"handlers": {
Expand All @@ -155,9 +155,9 @@ def configuration(smtpd):
"formatter": "default",
}
},
"root": {"level": "DEBUG", "handlers": ["wsgi"]},
"loggers": {
"faker": {"level": "WARNING"},
"canaille": {"level": "DEBUG", "handlers": ["wsgi"]},
},
"disable_existing_loggers": False,
},
Expand Down

0 comments on commit 68fc2f2

Please sign in to comment.