pub struct RedisLogger<CONN, PUBSUB, STREAM>{ /* private fields */ }Expand description
A logger that logs messages to Redis.
Implementations§
Source§impl<CONN, PUBSUB, STREAM> RedisLogger<CONN, PUBSUB, STREAM>where
CONN: ConnectionLike + Send + Sync + 'static,
PUBSUB: PubSubEncoder + 'static,
STREAM: StreamEncoder + 'static,
impl<CONN, PUBSUB, STREAM> RedisLogger<CONN, PUBSUB, STREAM>where
CONN: ConnectionLike + Send + Sync + 'static,
PUBSUB: PubSubEncoder + 'static,
STREAM: StreamEncoder + 'static,
Sourcepub fn new(
level: LevelFilter,
config: RedisLoggerConfig<CONN, PUBSUB, STREAM>,
) -> Box<Self>
pub fn new( level: LevelFilter, config: RedisLoggerConfig<CONN, PUBSUB, STREAM>, ) -> Box<Self>
Sourcepub fn init(
level: LevelFilter,
config: RedisLoggerConfig<CONN, PUBSUB, STREAM>,
) -> Result<(), SetLoggerError>
pub fn init( level: LevelFilter, config: RedisLoggerConfig<CONN, PUBSUB, STREAM>, ) -> Result<(), SetLoggerError>
Initializes the Redis logger with the specified log level and configuration.
§Arguments
level- The log level to set for the logger.config- The configuration for the Redis logger.
§Returns
Result indicating success or an error of type RedisLoggerConfigError.
If successful, the logger is set as the global logger.
§Errors
see above
Trait Implementations§
Source§impl<CONN, PUBSUB, STREAM> Debug for RedisLogger<CONN, PUBSUB, STREAM>where
CONN: ConnectionLike + Send + Sync + Debug,
PUBSUB: PubSubEncoder + Debug,
STREAM: StreamEncoder + Debug,
impl<CONN, PUBSUB, STREAM> Debug for RedisLogger<CONN, PUBSUB, STREAM>where
CONN: ConnectionLike + Send + Sync + Debug,
PUBSUB: PubSubEncoder + Debug,
STREAM: StreamEncoder + Debug,
Source§impl<CONN, PUBSUB, STREAM> Log for RedisLogger<CONN, PUBSUB, STREAM>
Implements the Log trait for the RedisLogger struct.
impl<CONN, PUBSUB, STREAM> Log for RedisLogger<CONN, PUBSUB, STREAM>
Implements the Log trait for the RedisLogger struct.
This implementation provides the necessary methods to enable logging to Redis.
The enabled method checks if the log level of the provided Metadata is less than or equal to the configured log level.
The log method publishes log messages to Redis channels and streams based on the configuration in one atomic operation using a pipeline.
The flush method is a no-op in this implementation.
Auto Trait Implementations§
impl<CONN, PUBSUB, STREAM> !Freeze for RedisLogger<CONN, PUBSUB, STREAM>
impl<CONN, PUBSUB, STREAM> RefUnwindSafe for RedisLogger<CONN, PUBSUB, STREAM>where
PUBSUB: RefUnwindSafe,
STREAM: RefUnwindSafe,
impl<CONN, PUBSUB, STREAM> Send for RedisLogger<CONN, PUBSUB, STREAM>
impl<CONN, PUBSUB, STREAM> Sync for RedisLogger<CONN, PUBSUB, STREAM>
impl<CONN, PUBSUB, STREAM> Unpin for RedisLogger<CONN, PUBSUB, STREAM>
impl<CONN, PUBSUB, STREAM> UnwindSafe for RedisLogger<CONN, PUBSUB, STREAM>where
PUBSUB: UnwindSafe,
STREAM: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more