Skip to content

Commit

Permalink
Rewrite debug docs (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
cewbdex committed Apr 10, 2024
1 parent 85dc7e1 commit 1fe290f
Showing 1 changed file with 67 additions and 2 deletions.
69 changes: 67 additions & 2 deletions docs/debugging.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,80 @@
# Debugging

When reporting a bug or posting questions to [issues](https://github.com/UniPiTechnology/evok/issues) please set logging levels in `/etc/evok/config.yaml` to `DEBUG`, restart Evok service and check the logs with command `journalctl -eu evok`. For more detailed log information you can also run Evok manually. In order to do that, you need to stop its service first.
Debugging allows you to see what is done internally in Evok, in case you face any troubles.

## Single start in debug mode

If you wish to debug a single event and then run Evok in normal mode, you can launch Evok in debug mode.
You need to stop the running Evok service first.

```bash title="Stopping Evok service"
systemctl stop evok
sudo systemctl stop evok
```

Now, you can manually run Evok in debug mode, the output will be printed to the terminal.

```bash title="Running Evok manually"
/opt/evok/bin/evok -d
```

## Setting permanent debug mode

If you need to debug an issue that occurs rarely, you can set Evok to run in debug mode permanently.
You have to change `logging: level:` to `DEBUG` in `/etc/evok/config.yaml`.
Use text editor of your choice, we recommend using `nano` (do `sudo apt install nano` if not present on your system).

```bash title="Editing configuration file"
sudo nano /etc/evok/config.yaml
```

Find this section:

```yaml
# +------------------+
# | Logging settings |
# +------------------+
logging:
level: WARNING
# ^ Minimum severity of messages to be logged, where minimum is CRITICAL.
# ^ Options: [CRITICAL, ERROR, WARNING, INFO, DEBUG]
```

And change the `level` value to `DEBUG`:

```yaml
# +------------------+
# | Logging settings |
# +------------------+
logging:
level: DEBUG
# ^ Minimum severity of messages to be logged, where minimum is CRITICAL.
# ^ Options: [CRITICAL, ERROR, WARNING, INFO, DEBUG]
```

Now, save via `CTRL+X`, then press `ENTER` and exit by `CTRL+X`.
The Evok service has to be restarted now.

```bash title="Restarting Evok service"
sudo systemctl restart evok
```

### Reading the logs

To read the logs from Evok in permanent debug mode, you can use following command. It also prints information about other related services.

```bash title="Viewing the Evok log"
journalctl -e -u evok
```

You can scroll in the outuput via arrow keys.
If you wish to copy the output (no scrolling), use following command:

```bash title="Copying the Evok log"
journalctl --no-pager -u evok -u unipi-one-modbus
```

This is more practical, as it's almost impossible to copy larger section of the log, when you have to scroll trough it.

!!! success

You can examine or copy the output.
Expand Down

0 comments on commit 1fe290f

Please sign in to comment.