Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
logging.cxx
Go to the documentation of this file.
1
34#include "logging.h"
35
36#if defined(__linux__) || defined(__MACH__)
37char logbuffer[4096];
38#elif defined(ESP_PLATFORM)
39char logbuffer[1024];
40#else
42char logbuffer[256];
43#endif
44
45#ifdef LOCKED_LOGGING
46os_mutex_t g_log_mutex = OS_MUTEX_INITIALIZER;
47#endif
48
49#ifdef MBED_USE_STDIO_LOGGING // TARGET_LPC1768
50
51extern "C" { void send_stdio_serial_message(const char* data); }
52
53void log_output(char* buf, int size) {
54 if (size <= 0) return;
55 buf[size] = '\0';
56 send_stdio_serial_message(buf);
57}
58
59#elif defined(__linux__) || defined(__MACH__) || defined(__EMSCRIPTEN__) || \
60 defined(ESP_PLATFORM)
61
62#include "utils/stdio_logging.h"
63
64#else
65
73__attribute__((weak)) void log_output(char* buf, int size) {}
74
75#endif
char logbuffer[256]
Temporary buffer to sprintf() the log lines into.
Definition logging.cxx:42
void log_output(char *buf, int size)
Prints a line of log to the log output destination.
Definition logging.cxx:73