Module: kamailio
Branch: master
Commit: 6235369e1deab4b87c999d5f00fb59b6609b3df6
URL: https://github.com/kamailio/kamailio/commit/6235369e1deab4b87c999d5f00fb59b…
Author: Xenofon Karamanos <xk(a)gilawa.com>
Committer: Xenofon Karamanos <xk(a)gilawa.com>
Date: 2024-12-03T14:19:43Z
cmake: Update platform-specific flags
- Update the platform-specific flags in the "os-specific.cmake" file for Linux and DragonFly BSD.
- Add new files "dragonfly.cmake" and "linux.cmake" in the "os-specific" directory to define the flags for DragonFly BSD and Linux, respectively.
- Add a new file "macos.cmake" in the "os-specific" directory to define the flags for Mac OS X.
- Update the "defs.cmake" file to print the availability of fast lock.
---
Added: cmake/os-specific/dragonfly.cmake
Added: cmake/os-specific/linux.cmake
Added: cmake/os-specific/macos.cmake
Modified: cmake/defs.cmake
Modified: cmake/os-specific.cmake
---
Diff: https://github.com/kamailio/kamailio/commit/6235369e1deab4b87c999d5f00fb59b…
Patch: https://github.com/kamailio/kamailio/commit/6235369e1deab4b87c999d5f00fb59b…
### Description
When calling inline functions using `app_python3s_exec()`, setting the level to critical using either `KSR.xlog.xcrit("foo\n")` or using `KSR.xlog.xlog("L_CRIT", "foo\n")` Do not set the level on the log line in a manner consistent with other log levels.
#### Reproduction
Kamailio code:
```
request_route {
app_python3s_exec("log_test");
. . .
}
```
Python code to contrast how info level logging and critical level logging differ:
```
def log_test():
KSR.xlog.xinfo("This line log level: xinfo = INFO\n");
KSR.xlog.xcrit("This line log level: xcrit = CRITICAL\n");
KSR.xlog.xlog("L_INFO", "This line log level: xlog = L_INFO\n");
KSR.xlog.xlog("L_CRIT", "This line log level: xlog = L_CRIT\n");
```
#### Log Messages
Log output. Note how the info level lines begin with INFO, but the critical level lines begin with an empty string:
```
2(8) INFO: <script>: This line log level: xinfo = INFO
2(8) : <script>: This line log level: xcrit = CRITICAL
2(8) INFO: <script>: This line log level: xlog = L_INFO
2(8) : <script>: This line log level: xlog = L_CRIT
```
### Possible Solutions
The critical level lines should begin with `CRITICAL` - this is what happens if the xlog function is called in Kamailio script. The output should look like this:
```
2(8) INFO: <script>: This line log level: xinfo = INFO
2(8) CRITICAL: <script>: This line log level: xcrit = CRITICAL
2(8) INFO: <script>: This line log level: xlog = L_INFO
2(8) CRITICAL: <script>: This line log level: xlog = L_CRIT
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
```
version: kamailio 5.8.4 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled on 15:03:24 Nov 18 2024 with gcc 13.2.1
```
* **Operating System**:
Tested in docker on Windows 11 (WSL2) using alpine linux as a base. `/etc/os-releas`:
```
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.20.2
PRETTY_NAME="Alpine Linux v3.20"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
```
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/4048
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/4048(a)github.com>