-
Try to define the
FULL_LOG_FILE_PATHas
#define FULL_LOG_FILE_PATH "/fs/logs.txt" -
You can find a very nice explanation how the
printfworks in Mbed OS 6, including overriding the console, at Hitchhiker's Guide to Printf in Mbed 6
To redirect theprintfit’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
}
}