Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ndb_redis: enhance debug info related to redis replies #1175

Merged
merged 1 commit into from Jul 3, 2017

Conversation

claudiupb
Copy link

@claudiupb claudiupb commented Jul 3, 2017

Pre-Submission Checklist

  • Commit message has the format required by CONTRIBUTING guide
  • Commits are split per component (core, individual modules, libs, utils, ...)
  • Each component has a single commit (if not, squash them into one commit)
  • 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

  • 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
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX 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.


if (redis_get_debug_level() < log_level)
return;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is a lot better. I will change the commit

@claudiupb
Copy link
Author

I have modified the commit to use is_printable, instead of defining a new function to get the log level for redis module.

@miconda miconda merged commit 4168a6c into kamailio:master Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants