slog_html/
style.rs

1#[derive(Clone, Copy)]
2/// Formatting style
3pub struct Style {
4    /// Optionally use custom color (hexadecimal color code)
5    pub color: Option<&'static str>,
6    /// Use bold font
7    pub bold: bool,
8    /// Use italic font
9    pub italic: bool,
10    /// Use custom CSS style
11    ///
12    /// Example: Some("background-color: #ffff7f;")
13    pub custom: Option<&'static str>,
14}
15
16impl Default for Style {
17    fn default() -> Self {
18        Style {
19            color: None,
20            bold: false,
21            italic: false,
22            custom: None,
23        }
24    }
25}
26
27#[derive(Clone, Copy)]
28pub struct StyleTable {
29    pub level: Style,
30    pub timestamp: Style,
31    pub message: Style,
32    pub key: Style,
33    pub value: Style,
34    pub separator: Style,
35}
36
37impl Default for StyleTable {
38    fn default() -> Self {
39        StyleTable {
40            level: Style {
41                color: None,
42                bold: false,
43                italic: false,
44                custom: None,
45            },
46            timestamp: Style {
47                color: None,
48                bold: false,
49                italic: false,
50                custom: None,
51            },
52            message: Style {
53                color: None,
54                bold: true,
55                italic: false,
56                custom: None,
57            },
58            key: Style {
59                color: Some("55557f"),
60                bold: true,
61                italic: false,
62                custom: None,
63            },
64            value: Style {
65                color: None,
66                bold: false,
67                italic: false,
68                custom: None,
69            },
70            separator: Style {
71                color: None,
72                bold: false,
73                italic: false,
74                custom: None,
75            },
76        }
77    }
78}