pub fn setup() -> Result<(), RedisError>
Expand description

Sets this logger as a global logger. Use this method to set up the logger. If this method is never called, the default logger is used which redirects the logging to the standard input/output streams.

§Note

The logging context (the module context raw::RedisModuleCtx) is set by the crate::redis_module macro. If another context should be used, please consider using the setup_for_context method instead.

In case this function is invoked before the initialisation, and so without the redis module context, no context will be used for the logging, however, the logger will be set.

§Example

This function may be called on a module startup, within the module initialisation function (specified in the crate::redis_module as the init argument, which will be used for the module initialisation and will be passed to the raw::Export_RedisModule_Init function when loading the module).