Browse Source

TT#97301 add description to log levels

Change-Id: I223d69016b5e6328f1124a6a977c46d008b667dc
pull/1164/head
Richard Fuchs 5 years ago
parent
commit
030f38ff16
7 changed files with 41 additions and 33 deletions
  1. +2
    -2
      daemon/cli.c
  2. +12
    -12
      daemon/loglevels.h
  3. +2
    -2
      lib/auxlib.c
  4. +8
    -1
      lib/loglib.c
  5. +3
    -2
      lib/loglib.h
  6. +2
    -2
      recording-daemon/loglevels.h
  7. +12
    -12
      t/loglevels.h

+ 2
- 2
daemon/cli.c View File

@ -385,7 +385,7 @@ static void int_diff_print_sz(long long start_param, void* current_param, size_t
option_string, cw, option) option_string, cw, option)
static void cli_incoming_diff_or_revert(struct cli_writer *cw, char* option) { static void cli_incoming_diff_or_revert(struct cli_writer *cw, char* option) {
#define ll(system) \
#define ll(system, descr) \
int_diff_print(common.log_levels[log_level_index_ ## system], "log-level-" #system); int_diff_print(common.log_levels[log_level_index_ ## system], "log-level-" #system);
#include "loglevels.h" #include "loglevels.h"
#undef ll #undef ll
@ -1207,7 +1207,7 @@ static void cli_incoming_list_loglevel(str *instr, struct cli_writer *cw) {
} }
static void cli_incoming_list_loglevels(str *instr, struct cli_writer *cw) { static void cli_incoming_list_loglevels(str *instr, struct cli_writer *cw) {
for (unsigned int i = 0; i < num_log_levels; i++) for (unsigned int i = 0; i < num_log_levels; i++)
cw->cw_printf(cw, "%s\n", log_level_names[i]);
cw->cw_printf(cw, "%s - %s\n", log_level_names[i], log_level_descriptions[i]);
} }
static void cli_incoming_set_loglevel(str *instr, struct cli_writer *cw) { static void cli_incoming_set_loglevel(str *instr, struct cli_writer *cw) {
int nl; int nl;


+ 12
- 12
daemon/loglevels.h View File

@ -1,12 +1,12 @@
ll(core)
ll(spandsp)
ll(ffmpeg)
ll(transcoding)
ll(codec)
ll(rtcp)
ll(ice)
ll(crypto)
ll(srtp)
ll(internals)
ll(http)
ll(control)
ll(core, "Everything that isn't part of another subsystem")
ll(spandsp, "Log messages generated by SpanDSP directly")
ll(ffmpeg, "Log messages generated by ffmpeg directly")
ll(transcoding, "Media and RTP transcoding")
ll(codec, "Codec negotation")
ll(rtcp, "RTCP handling")
ll(ice, "ICE negotation")
ll(crypto, "Negotation of SRTP, crypto suites, DTLS, SDES")
ll(srtp, "SRTP encryption and decryption")
ll(internals, "Noisy low-level internals")
ll(http, "HTTP, HTTPS, Websockets")
ll(control, "Control protocols including SDP exchanges, CLI")

+ 2
- 2
lib/auxlib.c View File

@ -141,8 +141,8 @@ void config_load(int *argc, char ***argv, GOptionEntry *app_entries, const char
AUTO_CLEANUP(GKeyFile *kf, free_gkeyfile) = g_key_file_new(); AUTO_CLEANUP(GKeyFile *kf, free_gkeyfile) = g_key_file_new();
#define ll(system) \
{ "log-level-" #system, 0, 0, G_OPTION_ARG_INT, &rtpe_common_config_ptr->log_levels[log_level_index_ ## system],"Log level for '" #system "'","INT" },
#define ll(system, descr) \
{ "log-level-" #system, 0, 0, G_OPTION_ARG_INT, &rtpe_common_config_ptr->log_levels[log_level_index_ ## system],"Log level for: " descr,"INT" },
GOptionEntry shared_options[] = { GOptionEntry shared_options[] = {
{ "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Print build time and exit", NULL }, { "version", 'v', 0, G_OPTION_ARG_NONE, &version, "Print build time and exit", NULL },


+ 8
- 1
lib/loglib.c View File

@ -31,11 +31,18 @@ write_log_t *write_log = (write_log_t *) log_both;
#define ll(system) #system,
#define ll(system, descr) #system,
const char * const log_level_names[] = { const char * const log_level_names[] = {
#include "loglevels.h" #include "loglevels.h"
NULL NULL
}; };
#undef ll
#define ll(system, descr) descr,
const char * const log_level_descriptions[] = {
#include "loglevels.h"
NULL
};
#undef ll


+ 3
- 2
lib/loglib.h View File

@ -30,16 +30,17 @@ void __ilog_np(int prio, const char *format, ...) __attribute__ ((format (printf
#define ll(system) log_level_index_ ## system,
#define ll(system, descr) log_level_index_ ## system,
enum __loglevels { enum __loglevels {
#include "loglevels.h" #include "loglevels.h"
ll(LAST)
ll(LAST, NULL)
}; };
#undef ll #undef ll
#define num_log_levels log_level_index_LAST #define num_log_levels log_level_index_LAST
extern const char * const log_level_names[]; extern const char * const log_level_names[];
extern const char * const log_level_descriptions[];
#ifndef __DEBUG #ifndef __DEBUG


+ 2
- 2
recording-daemon/loglevels.h View File

@ -1,2 +1,2 @@
ll(core)
ll(ffmpeg)
ll(core, "Everything that isn't part of another subsystem")
ll(ffmpeg, "Log messages generated by ffmpeg directly")

+ 12
- 12
t/loglevels.h View File

@ -1,12 +1,12 @@
ll(core)
ll(spandsp)
ll(ffmpeg)
ll(transcoding)
ll(codec)
ll(rtcp)
ll(ice)
ll(crypto)
ll(srtp)
ll(internals)
ll(http)
ll(control)
ll(core, "Everything that isn't part of another subsystem")
ll(spandsp, "Log messages generated by SpanDSP directly")
ll(ffmpeg, "Log messages generated by ffmpeg directly")
ll(transcoding, "Media and RTP transcoding")
ll(codec, "Codec negotation")
ll(rtcp, "RTCP handling")
ll(ice, "ICE negotation")
ll(crypto, "Negotation of SRTP, crypto suites, DTLS, SDES")
ll(srtp, "SRTP encryption and decryption")
ll(internals, "Noisy low-level internals")
ll(http, "HTTP, HTTPS, Websockets")
ll(control, "Control protocols including SDP exchanges, CLI")

Loading…
Cancel
Save