ckb_jsonrpc_types/
debug.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4/// Runtime logger config for extra loggers.
5#[derive(Clone, Default, Serialize, Deserialize, Debug, JsonSchema)]
6pub struct ExtraLoggerConfig {
7    /// Sets log levels for different modules.
8    ///
9    /// ## Examples
10    ///
11    /// Set the log level to info for all modules
12    ///
13    /// ```text
14    /// info
15    /// ```
16    ///
17    /// Set the log level to debug for listed modules and info for other modules.
18    ///
19    /// ```text
20    /// info,ckb-rpc=debug,ckb-sync=debug,ckb-relay=debug,ckb-tx-pool=debug,ckb-network=debug
21    /// ```
22    pub filter: String,
23}
24
25/// Runtime logger config.
26#[derive(Clone, Default, Serialize, Deserialize, Debug, JsonSchema)]
27pub struct MainLoggerConfig {
28    /// Sets log levels for different modules.
29    ///
30    /// `null` means keeping the current option unchanged.
31    ///
32    /// ## Examples
33    ///
34    /// Set the log level to info for all modules
35    ///
36    /// ```text
37    /// info
38    /// ```
39    ///
40    /// Set the log level to debug for listed modules and info for other modules.
41    ///
42    /// ```text
43    /// info,ckb-rpc=debug,ckb-sync=debug,ckb-relay=debug,ckb-tx-pool=debug,ckb-network=debug
44    /// ```
45    pub filter: Option<String>,
46    /// Whether printing the logs to the process stdout.
47    ///
48    /// `null` means keeping the current option unchanged.
49    pub to_stdout: Option<bool>,
50    /// Whether appending the logs to the log file.
51    ///
52    /// `null` means keeping the current option unchanged.
53    pub to_file: Option<bool>,
54    /// Whether using color when printing the logs to the process stdout.
55    ///
56    /// `null` means keeping the current option unchanged.
57    pub color: Option<bool>,
58}