forked from obsidian-tasks-group/obsidian-tasks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contrib: Add a page about the debug logging facilities
- Loading branch information
1 parent
47a0dbb
commit f79220f
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
contributing/Debugging/Console logging facilities in Tasks.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Console logging facilities in Tasks | ||
|
||
The source file [src/lib/logging.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/lib/logging.ts) provides a logging facility that writes to the developer console. | ||
|
||
## Enabling debug logging | ||
|
||
The `loggingOptions` section in the file `.obsidian/plugins/obsidian-tasks-plugin/data.json` vault determines the level of detail written out by Tasks. | ||
|
||
For example, change all the `info` values to `debug`. | ||
|
||
The available levels are: | ||
|
||
- `error`: Only show errors. | ||
- `warn`: Show warnings, and all above. | ||
- `info`: Show informational messages, and all above. | ||
- `debug`: Show debug messages and above. | ||
- `trace`: A `trace` message shows the call-stack to the log message. | ||
|
||
See a sample [data.json](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/resources/sample_vaults/Tasks-Demo/.obsidian/plugins/obsidian-tasks-plugin/data.json) file. | ||
|
||
## Adding logging to new locations | ||
|
||
New logging locations need to be added to `loggingOptions` in [src/Config/Settings.ts](https://github.com/obsidian-tasks-group/obsidian-tasks/blob/main/src/Config/Settings.ts), so that developers/users can easily adjust the logging levels. | ||
|
||
For now, if you wish to add new logging, please search the source code for uses of `logging.getLogger()`. |