mirror of
https://github.com/fluencelabs/redis
synced 2025-06-26 07:21:35 +00:00
Modules: changes to logging function.
This commit changes what provided by PR #3315 (merged) in order to let the user specify the log level as a string. The define could be also used, but when this happens, they must be decoupled from the defines in the Redis core, like in the other part of the Redis modules implementations, so that a switch statement (or a function) remaps between the two, otherwise we are no longer free to change the internal Redis defines.
This commit is contained in:
@ -1117,9 +1117,19 @@ handling is performed by Redis itself.
|
||||
|
||||
## `RM_Log`
|
||||
|
||||
void RM_Log(RedisModuleCtx *ctx, int level, const char *fmt, ...);
|
||||
void RM_Log(RedisModuleCtx *ctx, const char *levelstr, const char *fmt, ...);
|
||||
|
||||
Produces a log message to the standard Redis log, the format accepts
|
||||
printf-alike specifiers, while level is a string describing the log
|
||||
level to use when emitting the log, and must be one of the following:
|
||||
|
||||
* "debug"
|
||||
* "verbose"
|
||||
* "notice"
|
||||
* "warning"
|
||||
|
||||
If the specified log level is invalid, verbose is used by default.
|
||||
There is a fixed limit to the length of the log line this function is able
|
||||
to emit, this limti is not specified but is guaranteed to be more than
|
||||
a few lines of text.
|
||||
|
||||
Produce a log message into the standard Redis log. All standard Redis logging
|
||||
configuration applies here. Messages can only be logged after a module has
|
||||
initialized, and are prefixed by the name of the module. Log level is
|
||||
specified using the REDISMODULE_LOG_* macros.
|
||||
|
Reference in New Issue
Block a user