1

FIREBREATH 1.6 -- VC2010 -- No logging with FBLOG_TRACE("StaticInitialize()", "INIT-trace");

settings

outMethods.push_back(std::make_pair(FB::Log::LogMethod_File, "U:/logs/PT.log")); ... FB::Log::LogLevel getLogLevel(){ return FB::Log::LogLevel_Trace; ...


changing "FBLOG_TRACE" to "FBLOG_INFO" logging to Logfile works. I don´t understand the reason.

moskito-x
  • 11,832
  • 5
  • 47
  • 60

2 Answers2

2

function not inserted in its respective area

FB::Log::LogLevel getLogLevel(){
    return FB::Log::LogLevel_Trace; // Now Trace and above is logged.
}

Discription Logging here.

Enabling logging ...

  1. regenerate your project using the prep* scripts

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

...

About log levels

...

If you want to change the log level, you need to define the following in your Factory.cpp:

Referring to the above that means somewhere in "Factory.cpp". that´s incorrect. The description should say -->

If you want to change the log level, you need to define the following function inside the class definition for PluginFactory:

I drag it from bottom of "Factory.cpp" to inside Class PluginFactory. Now it works as expected !!!

moskito-x
  • 11,832
  • 5
  • 47
  • 60
  • Sorry, I guess I assumed a high level of C++ experience. I specified that you should override the method, which implies that it should be in your factory class. That can certainly be put in your .cpp file, but it does of course need to have a definition in the class header as well. This is standard C++ practice. – taxilian Apr 22 '12 at 02:57
  • 1
    long ago i realized it´s a good thing to read a description very carefully. For me it is adifference between **define the following in your Factory.cpp** and **define the following function inside the class definition for PluginFactory**. Nothing to do with **high level of C++ experience**. Just follow the instruction. I see how fast you change code in github. So please, to prevent other users, to point in the wrong direction. Change **define the following in your Factory.cpp** to **define the following function inside the class definition for PluginFactory**. Please. It costs me 2 days. ;) – moskito-x Apr 22 '12 at 06:55
  • 2
    FireBreath.org is a wiki; you are welcome to update it yourself! (I find that if I do all the updates people never learn how and I try to spend my time primarily fixing bugs rather than writing documentation; I think it's a small price to ask people using the system to help with that, given the time I spend on maintaining the project) – taxilian Apr 22 '12 at 15:06
  • 1
    +1 for highlighting **inside the class definition**. Saved my butt – kipple May 17 '13 at 02:44
  • @mossfoot : I have needed 2 days to figure that out :-) – moskito-x May 17 '13 at 12:12
1

The entire purpose of having different log levels (FBLOG_FATAL, FBLOG_ERROR, FBLOG_WARN, FBLOG_INFO, FBLOG_DEBUG, FBLOG_TRACE) is so that you can configure which level to use and anything below that level is hidden. The default log level in FireBreath is FB::Log::LogLevel_Info, which means that nothing below INFO (such as DEBUG or TRACE) will be visible.

You can change this by overriding FB::FactoryBase::getLogLevel() in your Factory class to return FB::Log::LogLevel_Trace.

The method you'd be overriding is: https://github.com/firebreath/FireBreath/blob/master/src/PluginCore/FactoryBase.cpp#L78

The definition of the LogLevel enum: https://github.com/firebreath/FireBreath/blob/master/src/ScriptingCore/logging.h#L69

There was a version of FireBreath in which this didn't work; I think it was fixed by 1.6.0, but I don't remember for certain. If that doesn't work try updating to the latest on the 1.6 branch (which is currently 1.6.1 as of the time of this writing but I haven't found time to release yet)

taxilian
  • 14,229
  • 4
  • 34
  • 73