Not being an expert C++ developer and finding the documentation on JUCE lacking useful examples of how to use the API is driving me bonkers. Thinking I might be better off trying the VST SDK first before getting too deep into JUCE.
- To log to a file should I be using Logger or FileLogger? I have basic dev console logging working OK. I tried the following code and got these compile time errors:
unknown type name: fileLog
then complains about arrow -> in 2nd line. I tried with ‘.’ and won’t work either.
fileLog->createDateStampedLogger(“TailGunnerSr”, “TailGunnerSr”, “.log”, “Tail Gunner Sr - Log File”);
I have the above code in a separate header file: myLogger.h does that make sense?
I also tried the following, however the plugin crashes since the file “tail-gun-test.log” doesn’t exist. I thought the FileLogger constructor would create a new file if one doesn’t exist as per the docs:
fileToWriteTo the file that to use - new messages will be appended to the file. If the file doesn’t exist, it will be created, along with any parent directories that are needed.
The code below crashes. If I change the File constructor to just:
Then it logs to the dev console OK, but doesn’t create a new file.
This is the code that crashes:
// in myLogger.h
FileLogger fileLog(logfile, “Welcome to Application”, 1000);
// in PluginEditor.cpp
fileLog.logMessage(“Testing 1 2 3!!!\n”);
Thanks for reading this far Hope you can shine a light.