Re: [sr-dev] [kamailio/kamailio] ndb_redis: enhance debug info related to redis replies (#1175)
Merged #1175. -- 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/1175#event-1148465872___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] ndb_redis: enhance debug info related to redis replies (#1175)
I have modified the commit to use is_printable, instead of defining a new function to get the log level for redis 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/1175#issuecomment-312648665___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] ndb_redis: enhance debug info related to redis replies (#1175)
claudiupb commented on this pull request. > @@ -1061,3 +1067,57 @@ int redis_count_err_and_disable(redisc_server_t *rsrv) } return 0; } + +void print_redis_reply(int log_level, redisReply *rpl,int offset) +{ + int i; + char padding[MAXIMUM_NESTED_KEYS + 1]; + + if (redis_get_debug_level() < log_level) + return; + Yes, this is a lot better. I will change the commit -- 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/1175#discussion_r125287638___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
Re: [sr-dev] [kamailio/kamailio] ndb_redis: enhance debug info related to redis replies (#1175)
miconda commented on this pull request. > @@ -1061,3 +1067,57 @@ int redis_count_err_and_disable(redisc_server_t *rsrv) } return 0; } + +void print_redis_reply(int log_level, redisReply *rpl,int offset) +{ + int i; + char padding[MAXIMUM_NESTED_KEYS + 1]; + + if (redis_get_debug_level() < log_level) + return; + I think that instead of the above IF condition you can use: ``` if(!is_printable(log_level)) ``` so redis_get_debug_level() is not needed at all. -- 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/1175#pullrequestreview-47661434___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev
[sr-dev] [kamailio/kamailio] ndb_redis: enhance debug info related to redis replies (#1175)
Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) Type Of Change - [x] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) Checklist: - [ ] PR should be backported to stable branches - [x] Tested changes locally - [ ] Related to issue # (replace with an open issue number) Description Added a way to print the redis responses when they are arrays, since the previous log message would just print (null) instead. In case a MULTI/EXEC transaction will be used to issue redis commands, the response would be an array, making the original debug message useless. With this new debug, arrays, strings, integers, and other replies such as status or error replies are logged properly. Also added an error message when a reply is expected but not received. You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/1175 -- Commit Summary -- * ndb_redis: enhance debug info related to redis replies -- File Changes -- M src/modules/ndb_redis/ndb_redis_mod.c (9) M src/modules/ndb_redis/redis_client.c (64) M src/modules/ndb_redis/redis_client.h (3) -- Patch Links -- https://github.com/kamailio/kamailio/pull/1175.patch https://github.com/kamailio/kamailio/pull/1175.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/1175 ___ Kamailio (SER) - Development Mailing List sr-dev@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev