[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-09-25 Thread Daniel-Constantin Mierla via sr-dev
OK, closing. A new PR can be created with other changes. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3902#issuecomment-2376050039 You are receiving this because you are subscribed to this thread. Message ID:

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-09-25 Thread Daniel-Constantin Mierla via sr-dev
Closed #3902. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3902#event-14410454366 You are receiving this because you are subscribed to this thread. Message ID: ___ Kamailio (SER) - Development Mailing

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-09-18 Thread Ivan Ribakov via sr-dev
> With this PR, I understood you actually want to replace the default > _ksr_slog_func(...) That is right. > so I added the option to be able to set the _ksr_slog_func. Thanks! I'll try to submit another PR with improvements to the `LOG_XX` macro as mentioned above for a uniform logging entr

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-09-18 Thread Daniel-Constantin Mierla via sr-dev
You can call `_ksr_slog_func(...)` function directly, with the `ksr_logdata_t` structure filled as you want. With this PR, I understood you actually want to replace the default `_ksr_slog_func(...)` with your own implementation from a module, so I added the option to be able to set the `_ksr_sl

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-09-09 Thread Ivan Ribakov via sr-dev
> Source file and line number are part of the structure passed to the > slog-function: I understand, my question was about the possibility of adding a flavour of the `LOG_XX` macro that takes file/line as arguments and populates the slog structure rather than always using `__FILE__`/`__LINE__`.

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-09-09 Thread Daniel-Constantin Mierla via sr-dev
Source file and line number are part of the structure passed to the slog-function: - https://github.com/kamailio/kamailio/blob/master/src/core/dprint.h#L348-L349 You can ignore the other fields if you don't need the corresponding attributes. -- Reply to this email directly or view it on GitH

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-09-09 Thread Ivan Ribakov via sr-dev
@miconda thanks for looking into this! Indeed it seems that structured logging takes care of most of our needs. But I'm not sure whether it would allow us to do uniform logging from config files. Let me explain: right now we're using custom log function from the PR and we're "manually" resolving

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-09-09 Thread Daniel-Constantin Mierla via sr-dev
I got a bit of the time to look deeper at it and seems to be a mechanism similar to structured logging, which is already used for JSON logging engine. See: - https://github.com/kamailio/kamailio/blob/master/src/core/dprint.h#L338-L353 I added a function to be able to set custom slog callback

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-08-30 Thread Daniel-Constantin Mierla via sr-dev
I will look into it in more details soon, summer holidays kept me out of the office quite a lot. It would be good to find a way to have a single framework that works for all logging related modules, like `log_custom` or `log_systemd` (maybe these modules can be adapted to the way proposed by thi

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-08-29 Thread Ivan Ribakov via sr-dev
> Does it affect in any way the modules log_custom or log_systemd? Hi @miconda , did the above answer provide sufficient details for you? > it seems rather important change considering that logging is critical > component Perhaps you would us to make any additional changes to further isolate th

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-08-29 Thread github-actions[bot] via sr-dev
This PR is stale because it has been open 6 weeks with no activity. Remove stale label or comment or this will be closed in 2 weeks. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3902#issuecomment-2319752277 You are receiving this because you are

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-07-18 Thread Ivan Ribakov via sr-dev
> Does it affect in any way the modules log_custom or log_systemd? It does not. Mentioned modules rely on the `_km_log_func` (set via `km_log_func_set`) while this patch uses `_km_custom_log_func` (set via `km_custom_log_func_set`) and makes no changes to the `_km_log_func`. The only downside

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-07-18 Thread Daniel-Constantin Mierla via sr-dev
I had no time for a proper review, it seems rather important change considering that logging is critical component. Does it affect in any way the modules `log_custom` or `log_systemd`? Maybe other can review as well and make remarks on this change. -- Reply to this email directly or view it o

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-07-11 Thread Nirv.Ana via sr-dev
Hi @miconda, is there anything else that needs clarifying? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/3902#issuecomment-361751 You are receiving this because you are subscribed to this thread. Message ID: _

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-07-04 Thread Ivan Ribakov via sr-dev
Hi @miconda , thanks for your feedback! Regarding `ksr_logdata_t`, most likely it got flagged by some static checker, but we've re-tested the original version and couldn't pin-point which exact check/rule triggered this. Regarding the `asprintf` - thanks for spotting the memory leak! We've ne

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-07-04 Thread Nirv.Ana via sr-dev
> Any reason that: > > ``` > ksr_logdata_t __kld = {0}; > ``` > > I replaced with: > > ``` > ksr_logdata_t __kld = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; > ``` I've reverted the change. > Also, `asprintf()` allocates memory, it is freed somewhere? It is now, at the end of the function. -- Reply

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-07-04 Thread Nirv.Ana via sr-dev
@anmartan pushed 1 commit. 2ecd44410be96c441f137a0c02ffe47a51f20fd9 --amend -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3902/files/52277d9b74e6ba2973ecaa0163a49be54bdd5454..2ecd44410be96c441f137a0c02ffe47a51f20fd9 You are receiving this because you are subscribed to this thr

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-07-04 Thread Daniel-Constantin Mierla via sr-dev
Any reason that: ``` ksr_logdata_t __kld = {0}; ``` I replaced with: ``` ksr_logdata_t __kld = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; ``` Also, `asprintf()` allocates memory, it is freed somewhere? Then, when this new mechanism is used and what is the benefit? Can you provide some examples? -- Re

[sr-dev] Re: [kamailio/kamailio] core: add support for custom log function (PR #3902)

2024-07-02 Thread Nirv.Ana via sr-dev
@anmartan pushed 1 commit. 52277d9b74e6ba2973ecaa0163a49be54bdd5454 core: add support for custom log function -- View it on GitHub: https://github.com/kamailio/kamailio/pull/3902/files/411b3c9fa3157437a0973cf66ee47fc6096b4e21..52277d9b74e6ba2973ecaa0163a49be54bdd5454 You are receiving this bec