sms: SMS where cropped (from VTY), concatenation of SMS where not possible
[osmocom-bb.git] / src / logging.c
index 8fd2e00..44fea98 100644 (file)
@@ -72,6 +72,28 @@ static const struct log_info_cat internal_cat[OSMO_NUM_DLIB] = {
                .loglevel = LOGL_NOTICE,
                .enabled = 1,
        },
+       [INT2IDX(DLINP)] = {
+               .name = "DINP",
+               .description = "A-bis Intput Subsystem",
+               .loglevel = LOGL_NOTICE,
+               .enabled = 1,
+       },
+       [INT2IDX(DLMUX)] = {
+               .name = "DMUX",
+               .description = "A-bis B-Subchannel TRAU Frame Multiplex",
+               .loglevel = LOGL_NOTICE,
+               .enabled = 1,
+       },
+       [INT2IDX(DLMI)] = {
+               .name = "DMI",
+               .description = "A-bis Input Driver for Signalling",
+               .enabled = 0, .loglevel = LOGL_NOTICE,
+       },
+       [INT2IDX(DLMIB)] = {
+               .name = "DMIB",
+               .description = "A-bis Input Driver for B-Channels (voice)",
+               .enabled = 0, .loglevel = LOGL_NOTICE,
+       },
 };
 
 /* You have to keep this in sync with the structure loglevel_strs. */
@@ -261,7 +283,7 @@ static void _logp(int subsys, int level, char *file, int line,
                 * in undefined state. Since _output uses vsnprintf and it may
                 * be called several times, we have to pass a copy of ap. */
                va_copy(bp, ap);
-               _output(tar, subsys, level, file, line, cont, format, ap);
+               _output(tar, subsys, level, file, line, cont, format, bp);
                va_end(bp);
        }
 }
@@ -475,8 +497,9 @@ int log_target_file_reopen(struct log_target *target)
 }
 
 /* This generates the logging command string for VTY. */
-const char *log_vty_command_string(const struct log_info *info)
+const char *log_vty_command_string(const struct log_info *unused_info)
 {
+       struct log_info *info = osmo_log_info;
        int len = 0, offset = 0, ret, i, rem;
        int size = strlen("logging level () ()") + 1;
        char *str;
@@ -549,8 +572,9 @@ err:
 }
 
 /* This generates the logging command description for VTY. */
-const char *log_vty_command_description(const struct log_info *info)
+const char *log_vty_command_description(const struct log_info *unused_info)
 {
+       struct log_info *info = osmo_log_info;
        char *str;
        int i, ret, len = 0, offset = 0, rem;
        unsigned int size =
@@ -619,7 +643,7 @@ int log_init(const struct log_info *inf, void *ctx)
 
        osmo_log_info->num_cat_user = inf->num_cat;
        /* total number = number of user cat + library cat */
-       osmo_log_info->num_cat = inf->num_cat + OSMO_NUM_DLIB;
+       osmo_log_info->num_cat = inf->num_cat + ARRAY_SIZE(internal_cat);
 
        osmo_log_info->cat = talloc_zero_array(osmo_log_info,
                                        struct log_info_cat,
@@ -637,4 +661,11 @@ int log_init(const struct log_info *inf, void *ctx)
        }
 
        /* copy over the library part */
+       for (i = 0; i < ARRAY_SIZE(internal_cat); i++) {
+               unsigned int cn = osmo_log_info->num_cat_user + i;
+               memcpy(&osmo_log_info->cat[cn],
+                       &internal_cat[i], sizeof(struct log_info_cat));
+       }
+
+       return 0;
 }