I’m trying to create a logfile that outputs only to the logfile and not to stdout console on my linux machine. But the logging data is going to the wrong place.
This is my code:
File logfile("application_gui.log"); FileLogger fl(logfile,T("Welcome to Application"),1000); FileLogger::writeToLog(T("Testing 1 2 3...\n"));
- The “Welcome to Application” output goes to stdout when I only want it to go to the “application_gui.log”
- The “Testing 1 2 3…” output only goes to stdout and doesn’t even go to the “application_gui.log”
I tried setting the logger location with the following to go to the logfile:
But I get this compile error:
ToolbarWorker.cpp:17: error: no matching function for call to ‘juce::Logger::setCurrentLogger(juce::FileLogger&, bool)’
juce_amalgamated.h:2516: note: candidates are: static void juce::Logger::setCurrentLogger(juce::Logger*, bool)
I can create a Logger object and setCurrentLogger works with it, but I don’t know how to specify the name of the text file with a Logger object, like this.
Logger* blah; FileLogger::setCurrentLogger(blah,false);
Any help appreciated.