Enabling logging

To enable logging in FireBreath, both for your own messages and the ones FireBreath generates, you need to do the following:

add the following to your PluginConfig.cmake

add_firebreath_library(log4cplus)

regenerate your project using the prep* scripts

open up Factory.cpp in your project. You need to define the following function inside the class definition for PluginFactory:

void getLoggingMethods( FB::Log::LogMethodList& outMethods )
{
// The next line will enable logging to the console (think: printf).
outMethods.push_back(std::make_pair(FB::Log::LogMethod_Console, std::string()));
// The next line will enable logging to a logfile.
outMethods.push_back(std::make_pair(FB::Log::LogMethod_File, "/foo/bar/baz.log"));
// Obviously, if you use both lines, you will get output on both sinks.
}

FireBreath will now log to the specified output. You can add your own log messages, by using the FBLOG_* macros that can be found in firebreath/src/ScriptingCore/logging.h.Example: