From 86c7cef181f3f0f804d1758570d57f1931a97ae0 Mon Sep 17 00:00:00 2001 From: KellerLiptrap <97915015+KellerLiptrap@users.noreply.github.com> Date: Wed, 4 Oct 2023 09:43:24 -0400 Subject: [PATCH] added to syslog doc --- README.md | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 88636850..d81d73d5 100644 --- a/README.md +++ b/README.md @@ -276,15 +276,37 @@ 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. +`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 addtion for each command that is run the `--debug-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>` with 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 `--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 below: + +``` +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?**