-
Try to define the
FULL_LOG_FILE_PATH
as
#define FULL_LOG_FILE_PATH "/fs/logs.txt"
-
You can find a very nice explanation how the
printf
works in Mbed OS 6, including overriding the console, at Hitchhiker's Guide to Printf in Mbed 6
To redirect theprintf
it’s sufficient to override the console only for the stdout file descriptor:
FileHandle *mbed::mbed_override_console(int fd)
{
if (fd == STDOUT_FILENO) {
...
return &logFile;
}
else {
return NULL; // don't override stdin and stderror
}
}