(&self, message: &str, extra: Option<HashMap<String, String>>)
| 152 | } |
| 153 | |
| 154 | pub fn error(&self, message: &str, extra: Option<HashMap<String, String>>) { |
| 155 | if self.should_log(LogLevel::Error) { |
| 156 | let msg = self.build_message(LogLevel::Error, message, extra.as_ref()); |
| 157 | if let Ok(mut writer) = self.writer.lock() { |
| 158 | let _ = writer.write_all(msg.as_bytes()); |
| 159 | let _ = writer.flush(); |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | pub fn tag(&self, key: &str, value: &str) -> TaggedLogger { |
| 165 | let mut tags = self.tags.clone(); |
nothing calls this directly
no test coverage detected