Skip to content

Commit

Permalink
Merge pull request #70 from AstuteSource/doc/syslog
Browse files Browse the repository at this point in the history
Syslog  added to documentation
  • Loading branch information
laurennevill authored Oct 31, 2023
2 parents d7a7bba + 6d3b187 commit af96c10
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,45 @@ create the tool's command-line arguments and options through a terminal user
interface (TUI). To use TUI-based way to create a complete command-line for
`chasten` you can type the command `chasten interact`.

## 📊Log
`Chasten` has a built-in system log. While using chasten you can use the command
`chasten log` in your terminal. The system log feature allows the user to see
events and messages that are produced by `chasten`. In addition, the `chasten log`
feature will assist in finding bugs and the events that led to the bug happening.
For the `chasten` program to display to the system log you will have to open a
separate terminal and use the command `chasten log`. In addition for each command
that is run the `--debug-level <choice of level>` and `--debug-dest SYSLOG` will
need to be added.

For example, `chasten datasette-serve --debug-level DEBUG --debug-dest SYSLOG
< database path to file>` will produce the following output in the system log.

```
💫 chasten: Analyze the AST of Python Source Code
🔗 GitHub: https://github.com/gkapfham/chasten
✨ Syslog server for receiving debugging information

Display verbose output? False
Debug level? DEBUG
Debug destination? SYSLOG
```
In each command in `chasten`, there is an option to add a `--debug-level`. The debug level has 5 options debug, info, warning, error, and critical. Each level will show different issues in the system log where debug is the lowest level of issue from the input where critical is the highest level of error. To leverage more info on this you can reference `debug.py` file:
``` python
class DebugLevel(str, Enum):
"""The predefined levels for debugging."""
DEBUG = "DEBUG"
INFO = "INFO"
WARNING = "WARNING"
ERROR = "ERROR"
CRITICAL = "CRITICAL"
```




## 🤗 Learning

- **Curious about the nodes that are available in a Python program's AST?**
Expand Down

0 comments on commit af96c10

Please sign in to comment.