mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-13 22:53:46 +01:00
Remove duplicate timestamp from test logs (_trial_temp/test.log
) (#15636)
Fix https://github.com/matrix-org/synapse/issues/15618
### Before
```
2023-05-17 22:51:36-0500 [-] 2023-05-17 22:51:36,889 - synapse.server - 338 - INFO - sentinel - Finished setting up.
```
### After
```
2023-05-19 18:16:20-0500 [-] synapse.server - 338 - INFO - sentinel - Finished setting up.
```
### Dev notes
The `Twisted.Logger` controls the `2023-05-19 18:16:20-0500 [-]` prefix, see : [`twisted/twisted` -> `src/twisted/logger/_format.py#L362-L374`](34b161e66b/src/twisted/logger/_format.py (L362-L374)
)
And we delegate our logs to the Twisted Logger for the tests which puts it in `_trial_temp/test.log`
This commit is contained in:
parent
737f7ddf58
commit
1903c7e5ed
2 changed files with 4 additions and 4 deletions
1
changelog.d/15636.misc
Normal file
1
changelog.d/15636.misc
Normal file
|
@ -0,0 +1 @@
|
|||
Remove duplicate timestamp from test logs (`_trial_temp/test.log`).
|
|
@ -40,10 +40,9 @@ def setup_logging() -> None:
|
|||
"""
|
||||
root_logger = logging.getLogger()
|
||||
|
||||
log_format = (
|
||||
"%(asctime)s - %(name)s - %(lineno)d - "
|
||||
"%(levelname)s - %(request)s - %(message)s"
|
||||
)
|
||||
# We exclude `%(asctime)s` from this format because the Twisted logger adds its own
|
||||
# timestamp
|
||||
log_format = "%(name)s - %(lineno)d - " "%(levelname)s - %(request)s - %(message)s"
|
||||
|
||||
handler = ToTwistedHandler()
|
||||
formatter = logging.Formatter(log_format)
|
||||
|
|
Loading…
Reference in a new issue