summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/logging_internal.h
Commit message (Collapse)AuthorAgeFilesLines
* logging: Move extern declaration of osmo_log_target_list from logging.h to ↵Pau Espin Pedrol2019-09-201-0/+1
| | | | | | | | | logging_internal.h This list is really not needed by applications and currently only used internally in logging.c and logging_vty.c. Change-Id: I5dca069512bfcd0826194427c5482fad8bfd0232
* logging_internal.h: Fix osmo_log_info definitionPau Espin Pedrol2019-09-171-1/+1
| | | | | | | | | Global symbol osmo_log_info is declared in logging.c as non-const, because it is modified. As soon as logging_internal.h is included into logging.c, the compiler warns about osmo_log_info being declared twice differently. Change-Id: Iea961c3caeb12ddf60c99d4dca644bb9ab538767
* logging vty: write: check logging levels validityNeels Hofmeyr2018-09-131-0/+1
| | | | Change-Id: If683b1272ad2d5b402b91c52c496aa7975bc6315
* logging vty: rewrite 'logging level' vty cmd generationNeels Hofmeyr2018-09-131-0/+14
Completely drop the implementations of log_vty_command_{str,description}(). These functions have been public API once, marked as deprecated since c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7 (March 2017). I considered to keep them, or reduce them to useless stubs, but it is quite silly, really. These functions are completely and utterly useless outside of libosmocore. Any program linking these deserves to fail. Re-implement vty logging level command gen, in logging_vty.c. logging.c is simply the wrong place for that. Introduce logging_internal.h to share logging definitions to logging_vty.c without publishing as API. Introduce static gen_logging_level_cmd_strs() to compose a list of category arguments with their descriptions for VTY commands. Use osmo_talloc_asprintf() instead of the previous error prone and chaotic strlen() counting method. Do not dynamically generate log level arguments, just keep static strings. We are super unlikely to ever change the log levels we have. No changes in logging_vty_test.vty: proves that there is no functional change. All of this, besides introducing basic sanity, is cosmetic preparation to be able to re-use the generic command generation code for arbitrary commands with category or level args (for deprecated and new keywords). Rationale: I want to hide 'all' and 'everything' from the VTY command documentation, by means of deprecating. I first tried to simply define a deprecated 'logging level CAT everything' command: logging level (all|rsl|rr|...) (debug|info|notice|error|fatal) logging level CAT everything # <- deprecated and hidden But unfortunately, command matching doesn't work as intended when the CAT argument reflects a valid category; I want it to invoke the deprecated function as soon as the 'everything' keyword follows, but it stays stuck to the "valid" command when the category argument matches an explicit keyword in that list, and will throw an error on the following 'everything' keyword. I.e.: logging level rsl everything % Unknown command # <-- leads to config file parse error logging level unknown_string everything % Ignoring deprecated 'everything' # <-- works only for invalid categories So I need to define 'everything' separately, again with a list of each valid category instead of a generic CAT arg. Change-Id: I3b083f27e3d751ccec258880ae7676e9af959a63