My boost version is 1.51.0. Compilation works fine, but unfortunately no output on the console or no "sample.log" file is created anywhere in my project directory respectively.
Thanks so far for your fast answer.
I've you don'T have any clue, so please let it me also know! So I will switch to another log framework as I've already invested 2 days for boost.log-> with no productive success yet. But I'm confidend, that you will give me a valuable hint!;)
Bye
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-10-30
Hi andysem,
I've tried the code above on a Ubuntu 12.04 LTS system. Boost version is 1.51.0 and boost.log in revision 733.
There it works: Output is generated in the console as well as in the sample.log file.
Nethertheless, it's still necessar to have it also runnable on my windows system. Maybe the compilation of the boost library and the boost.log libraries wasn't performed with the correct parameters, although the mentioned ones
bjam --build-type=complete mc-compiler=windmc
produced boost libraries without any error.
Hope you have a way to solve that issue.
thanks so far,
Degoah
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry, I don't have an easy access to a Windows machine. I will probably have a chance to experiment on the weekend.
In the meantime you can try stepping through the code in the debugger. Does it work if you don't call any init* functions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-10-30
Hi!
I've tried your purpose: Running without the init-functions (init_log_to_console and init_log_to_file). And guess what: It produces an output:
A trace severity message
A debug severity message
An informational severity message
A warning severity message
An error severity message
A fatal severity message
Great, if you have time and you get a windows machine, so please try to figure out why the way with the init-functions doesn't procude any output. In the meanwhile I'll use the debugger and figure out what is going on out there;)
Bye,
Degoah
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-10-31
Hi!
I works now. I'm not sure why, but it works.
What I've done was to delete all boost-libraries and to build the boost-framework again with this command string:
The compilation procedure finished without any big issue and the two boost.log libraries ""libboost_log-mgw47-1_51" and "libboost_log_setup-mgw47-mt-1_51" were created.
I've linked the example code above with the following libraries
In the 1st run I've received the following error message from the linker:
boost_1_51_0/boost/thread/tss.hpp:105: undefined reference to `__imp___ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb'
I've figured out, that this is a bug in the thread library, which just appears on some platforms.
A proposed solution was to define the following preprocessor symbol
#define BOOST_THREAD_USE_LIB 1
in the code.
After this the sample code compiled successfully and gave me the output below:
A trace severity message
A debug severity message
An informational severity message
A warning severity message
An error severity message
A fatal severity message
Thanks so far!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Are you sure you have libboost_log-mgw47-1_51 and not libboost_log-mgw47-mt-1_51? It seems odd you get non-multithreaded binary for Boost.Log and not for the rest of Boost.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-11-05
Hi,
after starting the building process with the following parameters
I've received the "libboost_log-mgw47-mt-1_51" binary file. Previously (mentioned in my first post), I've received a non-multithreaded library of Boost.Log.
Greetings
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
But where are the common attribute outputs like "LineID", "TimeStamp", "ProcessID" and "ThreadID"?
I understood, that when I call "logging::add_common_attributes();" I will receive this information on each log record additionally to my specific output strings.
Thanks in advance for your help!
Greetings,
Degoah
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You have to set up a formatter in order the attributes to appear in the output. The add_common_attributes function only adds the attributes to the core, it doesn't set up a formatter.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-11-22
Thanks for your fast response.
Does this even fit to the use of channel loggers? For example:
I would now expect such an output with the correctly setup of a formatter:
Airplane: SetFuelLever
I understand the channel logger as a possibilty to have the string, which was defined in the channel logger's constructor, on every log record. Is this correct? Ok, if i use the correct formatter too!?????
Thanks in advance for your help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-11-22
I think, I've got it how to output the channel string:
The attribute name to be used within the formatter to get the channel string was just "Channel".
I hope, this is the correct way, or is there a better approach?
Thank you so far for your hint regarding the formatter.
I think I've now understand the basic concept behind attributes and the formatter in boost.log:
Attributes are used as the keyword( placeholders) for the formatter and the filter logic. Every attribute defined can be used in the formatter or as keyword for the filters.
Sometimes it would be better, if the documentation would be read carefully and not just fluffy;)
Best regards from Germany!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I've downloaded and compiled successfully the boost.log sources from svn under Windows 7 using mingw-4.7.
Compilation string for the entire boost-sources including boost.log in the appropriate folders was:
As output I've received : "libboost_log-mgw47-1_51" and "libboost_log_setup-mgw47-mt-1_51".
IDE: eclipse-juno with CDT
However I see no output when running the trivial sample code below.
The same applies for the following code-snipped:
Could some give me a hint why I see nothing on the console?
Thanks a lot in advance,
Degoah
Could you specify the exact version of Boost.Log you downloaded?
Hi andysem,
I've downloaded the revision 733 from https://boost-log.svn.sourceforge.net/svnroot/boost-log/trunk.
My boost version is 1.51.0. Compilation works fine, but unfortunately no output on the console or no "sample.log" file is created anywhere in my project directory respectively.
Thanks so far for your fast answer.
I've you don'T have any clue, so please let it me also know! So I will switch to another log framework as I've already invested 2 days for boost.log-> with no productive success yet. But I'm confidend, that you will give me a valuable hint!;)
Bye
Hi andysem,
I've tried the code above on a Ubuntu 12.04 LTS system. Boost version is 1.51.0 and boost.log in revision 733.
There it works: Output is generated in the console as well as in the sample.log file.
Nethertheless, it's still necessar to have it also runnable on my windows system. Maybe the compilation of the boost library and the boost.log libraries wasn't performed with the correct parameters, although the mentioned ones
produced boost libraries without any error.
Hope you have a way to solve that issue.
thanks so far,
Degoah
Sorry, I don't have an easy access to a Windows machine. I will probably have a chance to experiment on the weekend.
In the meantime you can try stepping through the code in the debugger. Does it work if you don't call any init* functions?
Hi!
I've tried your purpose: Running without the init-functions (init_log_to_console and init_log_to_file). And guess what: It produces an output:
Great, if you have time and you get a windows machine, so please try to figure out why the way with the init-functions doesn't procude any output. In the meanwhile I'll use the debugger and figure out what is going on out there;)
Bye,
Degoah
Hi!
I works now. I'm not sure why, but it works.
What I've done was to delete all boost-libraries and to build the boost-framework again with this command string:
The compilation procedure finished without any big issue and the two boost.log libraries ""libboost_log-mgw47-1_51" and "libboost_log_setup-mgw47-mt-1_51" were created.
I've linked the example code above with the following libraries
In the 1st run I've received the following error message from the linker:
I've figured out, that this is a bug in the thread library, which just appears on some platforms.
https://svn.boost.org/trac/boost/ticket/4921
https://svn.boost.org/trac/boost/ticket/4258
A proposed solution was to define the following preprocessor symbol
in the code.
After this the sample code compiled successfully and gave me the output below:
Thanks so far!
Are you sure you have libboost_log-mgw47-1_51 and not libboost_log-mgw47-mt-1_51? It seems odd you get non-multithreaded binary for Boost.Log and not for the rest of Boost.
Hi,
after starting the building process with the following parameters
I've received the "libboost_log-mgw47-mt-1_51" binary file. Previously (mentioned in my first post), I've received a non-multithreaded library of Boost.Log.
Greetings
Hi once again:)!
if I execute the following code
…i just receive the following output:
But where are the common attribute outputs like "LineID", "TimeStamp", "ProcessID" and "ThreadID"?
I understood, that when I call "logging::add_common_attributes();" I will receive this information on each log record additionally to my specific output strings.
Thanks in advance for your help!
Greetings,
Degoah
You have to set up a formatter in order the attributes to appear in the output. The add_common_attributes function only adds the attributes to the core, it doesn't set up a formatter.
Thanks for your fast response.
Does this even fit to the use of channel loggers? For example:
I would now expect such an output with the correctly setup of a formatter:
I understand the channel logger as a possibilty to have the string, which was defined in the channel logger's constructor, on every log record. Is this correct? Ok, if i use the correct formatter too!?????
Thanks in advance for your help!
I think, I've got it how to output the channel string:
Please consider the following code snippet
The attribute name to be used within the formatter to get the channel string was just "Channel".
I hope, this is the correct way, or is there a better approach?
Thank you so far for your hint regarding the formatter.
I think I've now understand the basic concept behind attributes and the formatter in boost.log:
Attributes are used as the keyword( placeholders) for the formatter and the filter logic. Every attribute defined can be used in the formatter or as keyword for the filters.
Sometimes it would be better, if the documentation would be read carefully and not just fluffy;)
Best regards from Germany!