[vbox-dev] Logging in Custom COM Implementations

Adam Pridgen adam.pridgen at thecoverofnight.com
Thu Oct 18 11:49:09 PDT 2012

On Thu, Oct 18, 2012 at 12:05 PM, Adam Pridgen
<adam.pridgen at thecoverofnight.com> wrote:
> Thanks.
>> If your code includes include/Logging.h early (before anything else
>> drags in iprt/log.h) then all logging will go to the log group "main".
> I went through and moved all of the "Logging.h" includes to the top of
> each *.cpp and *.h files, but the classes are still not logging to the
> main group.  I am creating a debug build.  Before, I thought the
> framework was creating new groups for each class, but now I understand
> otherwise.
> I went back and re-read the wiki and the headers, and I replaced the
> "LogAlways" function calls with:
> LOG_GROUP_MAIN,("VBox.Main.Foo<functionName>: The address of this:
> 0x%08x\n", this));
> I ensured that the following log-pertinent variables were set during the build:
> BUILD_TYPE="debug"
> The following logging variables were set:
> VBOX_LOG=all
> VBOX_LOG_DEST=stderr
> The following log files were created:
> 2012-10-18-16-56-08.094-VBoxManage-23048.log
> 2012-10-18-16-56-08.097-VBoxSVC-23056.log
> 2012-10-18-16-56-09.018-VBoxHeadless-23067.log
> 2012-10-18-16-56-08.096-VBoxXPCOMIPCD-23051.log
> 2012-10-18-16-56-09.015-VBoxTestOGL-23063.log
> 2012-10-18-16-56-09.072-VBoxManage-23093.log
> I was expecting all the messages to appear in any of the files
> created, but the only logging message that happens is when the COM
> interface gets initialized.  I grep'ed through the files and I found
> only one instance of the "Foo" logging messages.  After the interface
> is initialized, none of the other LogIt messages are logged.
> Is there anything else that I can try?  Thanks for your help.
> -- Adam

I figured this out.  The reason the calls were not being logged was a
bug/typo in my Frontend/VBoxManage code.  I  was calling the wrong
function, which in turn bypassed all of my logging calls.

-- Adam

More information about the vbox-dev mailing list