Module: kamailio
Branch: master
Commit: e818baa1b21249529c93990ef0340dd8b56b26cf
URL: 
https://github.com/kamailio/kamailio/commit/e818baa1b21249529c93990ef0340dd8b56b26cf

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-06-12T13:47:18+02:00

pdb: use local log level for an info log message

- new mod param to allow remapping local log level for info
- related to GH #3296

---

Modified: src/modules/pdb/pdb.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/e818baa1b21249529c93990ef0340dd8b56b26cf.diff
Patch: 
https://github.com/kamailio/kamailio/commit/e818baa1b21249529c93990ef0340dd8b56b26cf.patch

---

diff --git a/src/modules/pdb/pdb.c b/src/modules/pdb/pdb.c
index 75013cccb7a..2cb54de8372 100644
--- a/src/modules/pdb/pdb.c
+++ b/src/modules/pdb/pdb.c
@@ -48,6 +48,7 @@ static int timeoutlogs = -10;  /*!< for aggregating timeout 
logs */
 static int *active = NULL;
 static uint16_t *global_id = NULL;
 
+ksr_loglevels_t _ksr_loglevels_pdb = KSR_LOGLEVELS_DEFAULTS;
 
 /*!
  * Generic parameter that holds a string, an int or a pseudo-variable
@@ -103,9 +104,15 @@ static cmd_export_t cmds[] = {
                {0, 0, 0, 0, 0, 0}};
 
 
-static param_export_t params[] = {{"server", PARAM_STRING, &modp_server},
-               {"timeout", INT_PARAM, &timeout}, {0, 0, 0}};
+/* clang-format off */
+static param_export_t params[] = {
+       {"server", PARAM_STRING, &modp_server},
+       {"timeout", PARAM_INT, &timeout},
+       {"ll_info", PARAM_INT, &_ksr_loglevels_pdb.ll_info},
 
+       {0, 0, 0}
+};
+/* clang-format on */
 
 struct module_exports exports = {
                "pdb",                   /* module name */
@@ -429,7 +436,7 @@ static int pdb_query(struct sip_msg *_msg, struct 
multiparam_t *_number,
                timeoutlogs = -10;
        }
        if(gettimeofday(&tnow, NULL) == 0) {
-               LM_INFO("got an answer in %f ms\n",
+               LLM_INFO("got an answer in %f ms\n",
                                ((double)(tnow.tv_usec - tstart.tv_usec
                                                  + (tnow.tv_sec - 
tstart.tv_sec) * 1000000))
                                                / 1000);

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to