#1 2014-10-03 16:38:33

Langley
Member
Registered: 2014-08-29
Posts: 4

Turning off "In AutoLoadModulesFromPath at..." messages

I'm experimenting with CppMicroServices 2.1.0 and more specifically the autoloading feature. Unfortunately, I haven't discovered how to turn off the logging when the AutoLoadModulesFromPath() method is running (without modifying the source for that function of course).

I'd love to set the logging level by just setting a configuration flag or programatically setting the logging level in my application. I tried using installMsgHandler(0) as the test in usDebugOutputTest.cpp did but that didn't turn off the logging coming from AutoLoadModulesFromPath. Clearly I'm missing something.

Thanks in advance for pointers. CppMicroServices looks very useful and I'm excited to use it.

- Langley

Offline

#2 2014-10-03 17:05:16

sascha
Administrator
Registered: 2012-05-04
Posts: 46

Re: Turning off "In AutoLoadModulesFromPath at..." messages

You run into a missing feature described in Issue 22, which has been implemented in the 22-log-levels branch. This branch is also merged into the development branch already.

To use the new ModuleSettings::SetLogLevel(MsgType) method you obviously would need to use the development branch of CppMicroServices. While this branch is called development, it is tested on Windows, Linux and MacOS and only contains commits where all unit tests pass so it should be quite safe to use. Of course there can and will be API changes in that branch. The branch will be the basis for the 3.0 release.

As a side note, the auto-load messages couldn't be suppressed reliably with log levels because they can happen during application start-up in the static initialization phase, before any user code is executed. So the messages will only be printed in debug mode (a CMake configure option). I am working on another solution to configure the CppMicroServices library from user code, taking into account early initialization issues.

Let me know if you are running into any other issues.

Thanks,
Sascha

Offline

#3 2014-10-03 17:13:52

Langley
Member
Registered: 2014-08-29
Posts: 4

Re: Turning off "In AutoLoadModulesFromPath at..." messages

Thank you for your amazingly quick reply Sascha!

Great news that this is a problem that has already been addressed in the development branch.

Do you have a "ballpark" estimate of when the 3.0 branch will be released? I'm in the process of checking CppMicroServices into our internal development infrastructure so that several of us can share it, consequently, I'd prefer to stick to released code.

Thanks again!

- Langley

Offline

#4 2014-10-03 17:27:46

sascha
Administrator
Registered: 2012-05-04
Posts: 46

Re: Turning off "In AutoLoadModulesFromPath at..." messages

You cought me in a good moment...

Have a look at this topic, which talks about a release date at the end of October.

The commits for the log-levels should be self-contained and you could try to cherry-pick ad74798ebfd88208c6d7288c3c22df95bbba6b92 (adds configurable log levels) and / or 488b0c0c3ce7174e6aad471223d3bb3f927ed86a (removes auto-load messages) on top of the 2.1.0 release branch.

Release 3.0 will bring a couple of breaking changes, but nothing severe. It will also have a couple of nice new features though.

Offline

Board footer

Powered by FluxBB