FastLED 3.10.8
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 68 of file log.cpp.hpp.

68 {
69 const char* tag;
70 switch (kind) {
71 case log_kind::WARN: tag = "): WARN: "; break;
72 case log_kind::ERROR: tag = "): ERROR: "; break;
73 case log_kind::INFO:
74 default: tag = "): INFO: "; break;
75 }
76 // Snapshot the user-supplied payload (the only thing `body`
77 // contains at entry — the macro fed it only `<< X`).
78 fl::string user_payload(body.str());
79 // Reset body's buffer and rebuild prefix-then-payload INTO body.
80 // body is in the caller's frame; the c_str() pointer we hand to
81 // println below lives until the end of the FL_WARN expression.
82 body.clear();
83 body << file << "(" << line << tag << user_payload.c_str();
84 fl::println(body.c_str());
85}
void clear() FL_NO_EXCEPT
Definition strstream.h:366
string str() const FL_NO_EXCEPT
Definition strstream.h:43
const char * c_str() const FL_NO_EXCEPT
Definition strstream.h:44
void println(const char *str) FL_NO_EXCEPT

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

Referenced by log_emit_auto(), and log_emit_auto().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: