| 180 | } |
| 181 | |
| 182 | void CecLogMessage(void *UNUSED(cbParam), const cec_log_message* message) |
| 183 | { |
| 184 | if ((message->level & g_cecLogLevel) == message->level) |
| 185 | { |
| 186 | std::string strLevel; |
| 187 | switch (message->level) |
| 188 | { |
| 189 | case CEC_LOG_ERROR: |
| 190 | strLevel = "ERROR: "; |
| 191 | break; |
| 192 | case CEC_LOG_WARNING: |
| 193 | strLevel = "WARNING: "; |
| 194 | break; |
| 195 | case CEC_LOG_NOTICE: |
| 196 | strLevel = "NOTICE: "; |
| 197 | break; |
| 198 | case CEC_LOG_TRAFFIC: |
| 199 | strLevel = "TRAFFIC: "; |
| 200 | break; |
| 201 | case CEC_LOG_DEBUG: |
| 202 | strLevel = "DEBUG: "; |
| 203 | break; |
| 204 | default: |
| 205 | break; |
| 206 | } |
| 207 | |
| 208 | std::string strFullLog; |
| 209 | strFullLog = StringUtils::Format("%s[%16lld]\t%s", strLevel.c_str(), message->time, message->message); |
| 210 | PrintToStdOut(strFullLog.c_str()); |
| 211 | |
| 212 | if (g_logOutput.is_open()) |
| 213 | { |
| 214 | if (g_bShortLog) |
| 215 | g_logOutput << message->message << std::endl; |
| 216 | else |
| 217 | g_logOutput << strFullLog.c_str() << std::endl; |
| 218 | } |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | void CecKeyPress(void *UNUSED(cbParam), const cec_keypress* UNUSED(key)) |
| 223 | { |
nothing calls this directly
no test coverage detected