FastLED 3.9.15
Loading...
Searching...
No Matches

◆ log_emit()

void fl::detail::log_emit ( log_kind kind,
const char * file,
int line,
fl::sstream & body )

Definition at line 31 of file log.cpp.hpp.

31 {
32 const char* tag;
33 switch (kind) {
34 case log_kind::WARN: tag = "): WARN: "; break;
35 case log_kind::ERROR: tag = "): ERROR: "; break;
36 case log_kind::INFO:
37 default: tag = "): INFO: "; break;
38 }
39 // Snapshot the user-supplied payload (the only thing `body`
40 // contains at entry — the macro fed it only `<< X`).
41 fl::string user_payload(body.str());
42 // Reset body's buffer and rebuild prefix-then-payload INTO body.
43 // body is in the caller's frame; the c_str() pointer we hand to
44 // println below lives until the end of the FL_WARN expression.
45 body.clear();
46 body << file << "(" << line << tag << user_payload.c_str();
47 fl::println(body.c_str());
48}
string str() const FL_NOEXCEPT
Definition strstream.h:43
void clear() FL_NOEXCEPT
Definition strstream.h:358
const char * c_str() const FL_NOEXCEPT
Definition strstream.h:44
void println(const char *str) FL_NOEXCEPT

References fl::basic_string::c_str(), ERROR, FL_NO_INLINE, FL_NOEXCEPT, INFO, fl::println(), and WARN.

+ Here is the call graph for this function: