From 3896fa0d3e128694fd9aaa5c8194d06816db8ddd Mon Sep 17 00:00:00 2001 From: nirenjan Date: Wed, 10 Nov 2021 22:21:47 -0800 Subject: [PATCH] Update protocol documentation for logging command --- daemon/protocol.dox | 85 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/daemon/protocol.dox b/daemon/protocol.dox index a58fe1a..6a991ca 100644 --- a/daemon/protocol.dox +++ b/daemon/protocol.dox @@ -58,6 +58,8 @@ strings describe the action, error or requested data. The list of supported commands are shown below: - @subpage proto_config +- @subpage proto_logging + */ /** @@ -236,3 +238,86 @@ configuration is applied to the running state. - `apply` */ + +/** +@page proto_logging Logging management + +The \c logging commands allow the user to fine tune the logging configuration +of \c x52d as well as adjust the log levels for either all the modules, or for +each of the modules individually. + +While the `-v` and `-q` command line options allow you to either increase the +logging verbosity or suppress it entirely, they are required to be specified at +program startup. On the other hand, having the `logging` commands allows the +user to fine tune the logging while the daemon is running. + +@tableofcontents + +# Modules + +\c x52d is split into several modules as far as logging is concerned. The list +of modules is below: + +- \c Config +- \c Clock +- \c Command +- \c Device +- \c IO +- \c LED +- \c Mouse + +# Logging levels + +The following is a list of supported logging levels. Each level logs the ones +above it as well as the current level + +- \c none - Disable logging entirely +- \c fatal - Log fatal messages +- \c error - Log error messages +- \c warning - Log warning messages +- \c info - Log informational messages +- \c debug - Log debug messages +- \c trace - Log trace messages - useful for tracing program flow. +- \c default - Not a level, but used when configuring module log levels, makes + the module log level fallback to the global log level. + +# Show logging configuration + +The `logging show` command takes in an optional module name, as listed in the +Modules section above. It returns the module name, if specified, and the log +level for that module. If the module is configured to fallback to the global +level, then it will return the global level. + +\b Arguments + +- `logging` +- `show` +- \a module-name (Optional) + +\b Returns + +- `DATA` +- \a module-name (if specified) +- \a log-level + +# Set logging configuration + +The `logging set` command takes in the optional module name and the log level +and sets the log level for that module, if specified, or the global level +otherwise. + +\b Arguments + +- `logging` +- `set` +- \a module-name (Optional) +- \a log-level + +\b Returns + +- `OK` +- `logging` +- `set` +- \a module-name (if specified) +- \a log-level +*/