hyperlane_plugin_logger/struct.rs
1use super::*;
2
3/// The configuration of the logger.
4#[derive(Clone, Debug)]
5pub struct LoggerConfig {
6 /// The highest level that is written.
7 pub level: LevelFilter,
8 /// The file the log is appended to, when there is one.
9 pub file: Option<String>,
10}
11
12/// The plugin that writes the log of the server.
13#[derive(Clone, Copy, Debug, Default)]
14pub struct LoggerPlugin;
15
16/// The middleware that notes when a request arrived.
17#[derive(Clone, Copy, Debug, Default)]
18#[hyperlane::request_middleware(-120)]
19pub struct RequestLogger;
20
21/// The middleware that writes the line of an answered request.
22#[derive(Clone, Copy, Debug, Default)]
23#[hyperlane::response_middleware(100)]
24pub struct ResponseLogger;