Harald Welte | 6a93cfb | 2021-12-09 12:56:27 +0100 | [diff] [blame] | 1 | [[remsim_logging]] |
| 2 | == osmo-remsim logging |
| 3 | |
| 4 | All programs within the osmo-remsim project use the logging sub-system of `libosmocore`. |
| 5 | |
| 6 | Contrary to the larger Osmocom projects with their own VTY + configuration file, the |
| 7 | logging configuration for osmo-remsim programs must happen via command line arguments. |
| 8 | |
| 9 | Also, contrary to the larger Osmocom projects, only logging to `stderr` is supported; |
| 10 | no direct logging to log files, syslog, systemd, etc. is supported at this point. |
| 11 | |
| 12 | === `-d` command line argument |
| 13 | |
| 14 | Every osmo-remsim program like `osmo-remsim-bankd`, `osmo-remsim-server` or |
| 15 | `osmo-remsim-client-st2` supports a `-d` command line argument. This argument |
| 16 | takes one mandatory parameter configuring the log level for each log sub-system |
| 17 | as follows: |
| 18 | |
| 19 | `-d SUBSYS,num_lvl[:SUBSYS,num_lvl[:...]]` |
| 20 | |
| 21 | So basically, a colon-separated list of tuples, where each tuple contains the |
| 22 | sub-system name and the _numeric_ log level. |
| 23 | |
| 24 | Below is the list of sub-systems and a table of numerical levels: |
| 25 | |
| 26 | .libosmocore log levels and their numeric values |
| 27 | [options="header",width="30%",cols="1,1"] |
| 28 | |=== |
| 29 | |Level name|Numeric value |
| 30 | |DEBUG|1 |
| 31 | |INFO|3 |
| 32 | |NOTICE|5 |
| 33 | |ERROR|7 |
| 34 | |FATAL|8 |
| 35 | |=== |
| 36 | |
| 37 | .osmo-remsim log sub-system names and their description |
| 38 | [options="header",width="50%",cols="1,2"] |
| 39 | |=== |
| 40 | |Sub-System Name|Description |
| 41 | |DMAIN|respective main program code |
| 42 | |DST2|SIMtrace2 `cardem` firmware interaction via USB |
| 43 | |DRSPRO|RSPRO protocol between bankd, server and client |
| 44 | |DREST|REST interface of `osmo-remsim-server` |
| 45 | |DSLOTMAP|slotmap code shared by `osmo-remsim-server` and `osmo-remsim-bankd` |
| 46 | |DBANKDW|worker threads of `osmo-remsim-bankd` |
| 47 | |=== |
| 48 | |
| 49 | === Example |
| 50 | |
| 51 | Putting the above in a concrete example: |
| 52 | |
| 53 | `-d DMAIN,5:DRSPRO,1` |
| 54 | |
| 55 | would perform the following configuration: |
| 56 | |
| 57 | * log only NOTICE (or higher) messages in the DMAIN subsystem (low verbosity) |
| 58 | * log DEBUG (or higher) messages in the DRSPRO subsystem (very high verbosity) |