| 151 | } |
| 152 | auto & state = logger_state(); |
| 153 | if (state.config_enabled) { |
| 154 | auto & output = logger_output_locked(state); |
| 155 | output << line << "\n"; |
| 156 | output.flush(); |
| 157 | } |
| 158 | callback = state.callback; |
| 159 | user_data = state.user_data; |
| 160 | } |
| 161 | if (callback) { |
| 162 | std::string text(line); |
| 163 | if (!text.empty() && text.back() != '\n') { |
| 164 | text.push_back('\n'); |
| 165 | } |
| 166 | callback(level, text.c_str(), user_data); |
| 167 | } |
no test coverage detected