mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-22 00:07:52 +01:00
10fd51498c
The Audiobookshelf logs sometimes contain information about the source of the log statement, but sometimes they don't This really depends on developers adding these information to the log messages. But even then, the information is usually just a hint about the module logging this, like `[Db]` or [Watcher]`, and finding the exact line can be hard. This patch automatically adds the source of the log statement to the logs. This means if someone calls `Logger.info(…)` in line `22` of `foo.js`, the log statement will contain this file and line: ``` [2023-01-05 19:04:12[ (LogManager.js:85:18) DEBUG: Daily Log file found 2023-01-05.txt [2023-01-05 19:04:12] (LogManager.js:59:12) INFO: [LogManager] Init current daily log filename: 2023-01-05.txt ``` This should make it much easier to identify the code where the log statement originated from. Long-term, this also means that we can probably remove the manually set identifiers contained in the log messages, like the `[LogManager]` in the example above. |
||
---|---|---|
.. | ||
controllers | ||
finders | ||
libs | ||
managers | ||
objects | ||
providers | ||
routers | ||
scanner | ||
utils | ||
Auth.js | ||
Db.js | ||
Logger.js | ||
Server.js | ||
SocketAuthority.js | ||
Watcher.js |