Skip to content

Commit

Permalink
Adds some screenshots for logging configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dylon committed Dec 9, 2024
1 parent 5ed756d commit 6924afd
Showing 1 changed file with 15 additions and 21 deletions.
36 changes: 15 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,28 +214,20 @@ root, run the following command: `xvfb-run npm run integ`:

### Configuring logging

![Configuring Logging](https://lfortran.github.io/lfortran-lsp/videos/configuring-logging-lfortran-lsp.gif)

The first step when debugging is to examine the respective logs. This extension
has solid support for logging at various levels, including inputs and outputs to
functions and benchmarks. What is logged is configurable in the following ways:
1. Log level := Granularity of logs to print.
<dl>
<dt>off</dt>
<dd>Do not print any logs.</dd>
<dt>fatal</dt>
<dd>Only log messages about errors that cannot be recovered from.</dd>
<dt>error</dt>
<dd>Log errors that prevent functionality but can be recovered from.</dd>
<dt>warn</dt>
<dd>Log errors that can be recovered from with default behavior.</dd>
<dt>info</dt>
<dd>Log informational messages that are demonstrate the extension is running correctly. These may be helpful to non-developer users.</dd>
<dt>debug</dt>
<dd>Log additional information that is useful for debugging, but not to the level of recording inputs and outputs of functions.</dd>
<dt>trace</dt>
<dd>Highest granularity of logging that includes such things as inputs and outputs to functions.</dd>
<dt>all</dt>
<dd>Show all the logs. This is currently equivalent to `trace`.</dd>
</dl>
1. Log level := Granularity of logs to print. ![Log Level](https://lfortran.github.io/lfortran-lsp/images/log-level-configuration-lfortran-lsp.png)
- `off` := Do not print any logs.
- `fatal` := Only log messages about errors that cannot be recovered from.
- `error` := Log errors that prevent functionality but can be recovered from.
- `warn` := Log errors that can be recovered from with default behavior.
- `info` := Log informational messages that are demonstrate the extension is running correctly. These may be helpful to non-developer users.
- `debug` := Log additional information that is useful for debugging, but not to the level of recording inputs and outputs of functions.
- `trace` := Highest granularity of logging that includes such things as inputs and outputs to functions.
- `all` := Show all the logs. This is currently equivalent to `trace`.
2. Log filter := Regular expression used to narrow which messages are logged. If
you are not familiar with regular expressions, you may treat the respective
field as a plain text field, for the most part. There are some symbols to
Expand All @@ -245,14 +237,16 @@ functions and benchmarks. What is logged is configurable in the following ways:
[regular-expressions.info](https://www.regular-expressions.info/javascript.html)
or the
[Mozilla documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions).
![Log Filter](https://lfortran.github.io/lfortran-lsp/images/log-filter-configuration-lfortran-lsp.png)
3. Benchmarking := Logs the number of milliseconds required to complete an
operation along with some (moving) summary statistics. The summary statistics
include the mean, standard deviation, minimum, and maximum execution times.
The moving statistics are computed using
[Welford's online algorithm](https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm).
![Benchmarking](https://lfortran.github.io/lfortran-lsp/images/benchmark-configuration-lfortran-lsp.png)
4. Pretty-printing := Whether to indent each array element and object field
relative to its nested level in a manner that makes them easy to examine and
understand. This includes the size of each indentation level (the number of
spaces to add per level of indentation).

![Configuring Logging](https://lfortran.github.io/lfortran-lsp/videos/configuring-logging-lfortran-lsp.gif)
![Pretty-Print](https://lfortran.github.io/lfortran-lsp/images/pretty-print-configuration-lfortran-lsp.png)
![Indent Size](https://lfortran.github.io/lfortran-lsp/images/indent-size-configuration-lfortran-lsp.png)

0 comments on commit 6924afd

Please sign in to comment.