Skip to content

Commit

Permalink
New log methods to track objects (#1871)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-NRCan authored Feb 28, 2024
1 parent bfbfe73 commit b960a32
Show file tree
Hide file tree
Showing 2 changed files with 160 additions and 81 deletions.
9 changes: 8 additions & 1 deletion docs/programming/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ The `LOG_TRACE` functions are used when the developer wants to view the call sta

Typically, to debug an application, the developer should use `logger.logDebug()` and when they are done, they should remove the line after some time. The line can be committed and remain in the code for a while, but they aren't meant to stay forever.

A neat feature of the `logger` is also the possibility to log using timing markers. Call `logMarkerStart` to start a timer using a key and then call `logMarkerCheck` and provide the same key to log the time span between 'now' and the 'start' time.
A neat feature of the `logger` is the possibility to log using timing markers. Call `logMarkerStart` to start a timer using a key and then call `logMarkerCheck` and provide the same key to log the time span between 'now' and the 'start' time.

Another neat feature of the `logger` is the possibility to track an object and log when they changed or whenever we want. Call `logTrackerStart` to start an interval timer which constantly checks object value. Below is an example of how to call it.:
```ts
let toto = 1;
logger.logTrackerStart('test', () => toto);
```
Remember to call `logTrackerStop` to stop tracking.

## Characteristics to know when using `useWhatChanged` ##

Expand Down
Loading

0 comments on commit b960a32

Please sign in to comment.