This overload is used primarily with fixed string values. It sends a pointer to the string whose memory does not need to be reclaimed later. This is the most efficient form, but it only works with fixed messages.
| 293 | // This is the most efficient form, but it only works |
| 294 | // with fixed messages. |
| 295 | void Channel::sendLine(MsgLevel level, const char* line) { |
| 296 | if (outputTask) { |
| 297 | LogMessage msg { this, (void*)line, level, false }; |
| 298 | while (!xQueueSend(message_queue, &msg, 10)) {} |
| 299 | } else { |
| 300 | print_msg(level, line); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | // This overload is used primarily with log_*() where |
| 305 | // a std::string is dynamically allocated with "new", |