This is a complete refactor of cdp log. In particular:
- It removes escape chars for colors in log: they are most of the times not interpreted so they are messing up the logs
- It refactors some log level, moving to ERROR from WARN some errors during peer connections
- In DEBUG level, cdp is too much verbose and also syslogs complains about rate-limiting. Instead of removing some logs (which is quite unfair), let's introduce a new modparam (debug_heavy) in order to activate some logs which gives some side informations about peers status. This modparam is not active by default but this can be enabled easily re-introducing previous debug logs You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/692
-- Commit Summary --
* cdp: Review log level on peer_connect() function * cdp: Remove escape chars for colors in log * cdp: Review of logging of cdp
-- File Changes --
M modules/cdp/globals.h (10) M modules/cdp/mod.c (2) M modules/cdp/peermanager.c (27) M modules/cdp/peermanager.h (2) M modules/cdp/peerstatemachine.c (2) M modules/cdp/receiver.c (34) M modules/cdp/receiver.h (2) M modules/cdp/session.c (74) M modules/cdp/session.h (2) M modules/cdp/tcp_accept.c (2) M modules/cdp/tcp_accept.h (2) M modules/cdp/transaction.c (1)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/692.patch https://github.com/kamailio/kamailio/pull/692.diff
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/692
The patch cc68bea adds a new parameter for the module -- you have to add documentation for it in the files from doc/ subfolder of the module.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/692#issuecomment-230254501
@fedefava86 pushed 1 commit.
c78d111 cdp: Update doc of module with "debug_heavy" param
--- You are receiving this because you are subscribed to this thread. View it on GitHub: https://github.com/kamailio/kamailio/pull/692/files/cc68bea26eee85b9918716f9...
@miconda You are right. Completely agree with you. Done.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/692#issuecomment-230261114
Thanks, I am going to merge it.
On the other hand, if you want to clean a bit more the log messages, you can remove the name of the function from the log message, because now it is added automatically.
For example:
``` LM_INFO("peer_connect(): Trying to connect t... ```
should become:
``` LM_INFO("Trying to connect t... ```
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/692#issuecomment-230278742
Merged #692.
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/692#event-711976671
Ok @miconda , thanks for the hint. I will do it as soon as possible
--- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/692#issuecomment-230279550