[log] Boost Logging Lib v0.11 - can find the logger/filter based on your scenario

Hi all, There's a new version of Boost Log: http://torjo.com/log2/ http://torjo.com/log2/doc/html/ - can find the right filter/logger based on your application's needs: http://torjo.com/log2/doc/html/namespaceboost_1_1logging_1_1scenario_1_1usag... http://torjo.com/log2/doc/html/scenarios_code.html#common_your_scenario_code (code) http://torjo.com/log2/doc/html/common_scenarios.html#common_your_scenario - added TLS - added scenarios in the docs - allow for fast compiles - compiles with gcc 3.4.2, gcc 4.1 and VC 2005 Feedback is most welcome! Best, John -- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of John Torjo Sent: 08 November 2007 23:08 To: boostdevel Subject: [boost] [log] Boost Logging Lib v0.11 - can find the logger/filter based on your scenario
There's a new version of Boost Log: http://torjo.com/log2/ http://torjo.com/log2/doc/html/
Looks cool ;-) Hope it/you survives 'a week in the stocks' this time ;-) Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com

He he ;) What do you mean by "a week in the stocks"? Best, John
There's a new version of Boost Log: http://torjo.com/log2/ http://torjo.com/log2/doc/html/
Looks cool ;-)
Hope it/you survives 'a week in the stocks' this time ;-)
Paul
--- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of John Torjo Sent: 09 November 2007 15:03 To: boost@lists.boost.org Subject: Re: [boost] [log] Boost Logging Lib v0.11 - can find the logger/filter based on your scenario
What do you mean by "a week in the stocks"?
(For the benefit of those whose native lands do not include these items on village greens, sadly unused these days, 'stocks' were wooden seats with bars with cutouts to enforce a period where the other villagers could take out their displeasure by throwing bad fruit, eggs, and sometimes worse abuse, at miscreants). Well Joel Guzman described the experience of a review as 'more exciting than bungee jumping' - but I thought, judging by your experience, and that of others, it was more like "a week in the stocks". But in many cases the pain of review has results in a better, sometimes much better, products. Paul --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com

Oh, I see :) This is definitely a waaaay better product! So I'm quite glad my first version got rejected - this new and improved one would have never appeared otherwise :P Best, John
(For the benefit of those whose native lands do not include these items on village greens, sadly unused these days, 'stocks' were wooden seats with bars with cutouts to enforce a period where the other villagers could take out their displeasure by throwing bad fruit, eggs, and sometimes worse abuse, at miscreants).
Well Joel Guzman described the experience of a review as 'more exciting than bungee jumping' - but I thought, judging by your experience, and that of others, it was more like "a week in the stocks".
But in many cases the pain of review has results in a better, sometimes much better, products.
Paul
--- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

Am Freitag 09 November 2007 00:08:03 schrieb John Torjo:
Hi all,
There's a new version of Boost Log: http://torjo.com/log2/ http://torjo.com/log2/doc/html/
- can find the right filter/logger based on your application's needs:
http://torjo.com/log2/doc/html/namespaceboost_1_1logging_1_1scenario_1_1usa ge.html http://torjo.com/log2/doc/html/scenarios_code.html#common_your_scenario_cod e (code) http://torjo.com/log2/doc/html/common_scenarios.html#common_your_scenario
- added TLS - added scenarios in the docs - allow for fast compiles - compiles with gcc 3.4.2, gcc 4.1 and VC 2005
Feedback is most welcome!
Best, John
Hello John, Can you spend some Makefiles/bjam files for building the samples? From what I can read out of basic_usage.vcproj dir_spec.cpp file_statistics.cpp log.cpp main.cpp parse_file.cpp util.cpp have to be complied into an executable, but this gives me bunch off error s (see attachment) . I'm on Linux using gcc-4.2 Regards, - Maik

Hi Maik, Ouch :) Sorry, I had a test which allowed TSS to run only on Windows. Could you please try again, with the latest code from SVN? http://svn.boost.org/svn/boost/sandbox/logging/ Best, John
Hello John,
Can you spend some Makefiles/bjam files for building the samples?
From what I can read out of basic_usage.vcproj dir_spec.cpp file_statistics.cpp log.cpp main.cpp parse_file.cpp util.cpp have to be complied into an executable, but this gives me bunch off error s (see attachment) .
I'm on Linux using gcc-4.2
Regards, - Maik
------------------------------------------------------------------------
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

Am Freitag 09 November 2007 23:23:57 schrieb John Torjo:
Hi Maik,
Ouch :) Sorry, I had a test which allowed TSS to run only on Windows. Could you please try again, with the latest code from SVN? http://svn.boost.org/svn/boost/sandbox/logging/
Best, John
Failed for other reasons ( see attached log ) Maik

Ouch 2 :) Fixed, should work now. Again, please take the latest from SVN. Best, John
Am Freitag 09 November 2007 23:23:57 schrieb John Torjo:
Hi Maik,
Ouch :) Sorry, I had a test which allowed TSS to run only on Windows. Could you please try again, with the latest code from SVN? http://svn.boost.org/svn/boost/sandbox/logging/
Best, John
Failed for other reasons ( see attached log )
Maik
------------------------------------------------------------------------
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

On Fri, Nov 09, 2007 at 11:39:38PM +0100, Maik Beckmann wrote:
Am Freitag 09 November 2007 23:23:57 schrieb John Torjo:
Ouch :) Sorry, I had a test which allowed TSS to run only on Windows. Could you please try again, with the latest code from SVN? http://svn.boost.org/svn/boost/sandbox/logging/
Failed for other reasons ( see attached log )
There are indeed many more errors. I tried to fix these but failed probably because of many circular header dependencies. Adding a missing header causes always many other errors ... Please inspect these e.g. via doxygen. I attached a patch which fixes at least a few superfluous semicolons. Why do you use these? Compile with -pedantic -Wall -W! I get the following errors compiling a single main.cpp: g++ -I ~/Boost/svn/logging/ -pedantic -I ~/Boost/svn/trunk/ -Wall -W main.cpp In file included from main.cpp:64: log.h:7: error: specialization of ‘boost::logging::formatter::msg_type<boost::logging::override>’ after instantiation log.h:7: error: redefinition of ‘struct boost::logging::formatter::msg_type<boost::logging::override>’ /home/jens/Programme/Entwicklung/Boost/svn/logging/boost/logging/detail/format_msg_type.hpp:38: error: previous definition of ‘struct boost::logging::formatter::msg_type<boost::logging::override>’ log.h:17: error: ‘level’ has not been declared log.h:17: error: expected constructor, destructor, or type conversion before ‘&’ token log.h:17: error: ‘level’ was not declared in this scope log.h:17: error: wrong number of template arguments (1, should be 2) ~/Boost/svn/logging/boost/logging/detail/log_keeper.hpp:81: error: provided for ‘template<class type, type& (* func)()> struct boost::logging::detail::log_filter_keeper’ log.h:17: error: invalid type in declaration before ‘;’ token main.cpp: In function ‘int main(int, char**)’: main.cpp:119: error: base operand of ‘->’ is not a pointer main.cpp:123: error: base operand of ‘->’ is not a pointer main.cpp:125: error: base operand of ‘->’ is not a pointer ~/Boost/svn/trunk/boost/system/error_code.hpp: At global scope: ~/Boost/svn/trunk/boost/system/error_code.hpp:176: warning: ‘boost::system::errno_ecat’ defined but not used ~/Boost/svn/trunk/boost/system/error_code.hpp:177: warning: ‘boost::system::native_ecat’ defined but not used Jens

Hi Jens, Do you still get errors now, after the second ouch :) ? (that is, my second email to Maik) p.s. I'll apply your fixes soon - in a few hours most likely. Best, John
On Fri, Nov 09, 2007 at 11:39:38PM +0100, Maik Beckmann wrote:
Am Freitag 09 November 2007 23:23:57 schrieb John Torjo:
Ouch :) Sorry, I had a test which allowed TSS to run only on Windows. Could you please try again, with the latest code from SVN? http://svn.boost.org/svn/boost/sandbox/logging/
Failed for other reasons ( see attached log )
There are indeed many more errors. I tried to fix these but failed probably because of many circular header dependencies. Adding a missing header causes always many other errors ... Please inspect these e.g. via doxygen.
I attached a patch which fixes at least a few superfluous semicolons. Why do you use these? Compile with -pedantic -Wall -W!
I get the following errors compiling a single main.cpp:
g++ -I ~/Boost/svn/logging/ -pedantic -I ~/Boost/svn/trunk/ -Wall -W main.cpp In file included from main.cpp:64: log.h:7: error: specialization of 'boost::logging::formatter::msg_type<boost::logging::override>' after instantiation log.h:7: error: redefinition of 'struct boost::logging::formatter::msg_type<boost::logging::override>' /home/jens/Programme/Entwicklung/Boost/svn/logging/boost/logging/detail/format_msg_type.hpp:38: error: previous definition of 'struct boost::logging::formatter::msg_type<boost::logging::override>' log.h:17: error: 'level' has not been declared log.h:17: error: expected constructor, destructor, or type conversion before '&' token log.h:17: error: 'level' was not declared in this scope log.h:17: error: wrong number of template arguments (1, should be 2) ~/Boost/svn/logging/boost/logging/detail/log_keeper.hpp:81: error: provided for 'template<class type, type& (* func)()> struct boost::logging::detail::log_filter_keeper' log.h:17: error: invalid type in declaration before ';' token main.cpp: In function 'int main(int, char**)': main.cpp:119: error: base operand of '->' is not a pointer main.cpp:123: error: base operand of '->' is not a pointer main.cpp:125: error: base operand of '->' is not a pointer ~/Boost/svn/trunk/boost/system/error_code.hpp: At global scope: ~/Boost/svn/trunk/boost/system/error_code.hpp:176: warning: 'boost::system::errno_ecat' defined but not used ~/Boost/svn/trunk/boost/system/error_code.hpp:177: warning: 'boost::system::native_ecat' defined but not used
Jens
------------------------------------------------------------------------
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

On Sat, Nov 10, 2007 at 01:57:55AM +0200, John Torjo wrote:
Do you still get errors now, after the second ouch :) ? (that is, my second email to Maik)
Oh, yes! Compiling the *.cpp files in lib/logging/samples/basic_usage I get using g++ 4.2.3: g++ -I ~/Boost/svn/logging/ -pedantic -I ~/Boost/svn/trunk/ -Wall -W *.cpp In file included from dir_spec.cpp:4: log.h:7: error: specialization of ‘boost::logging::formatter::msg_type<boost::logging::override>’ after instantiation log.h:7: error: redefinition of ‘struct boost::logging::formatter::msg_type<boost::logging::override>’ ~/Boost/svn/logging/boost/logging/detail/format_msg_type.hpp:38: error: previous definition of ‘struct boost::logging::formatter::msg_type<boost::logging::override>’ ~/Boost/svn/trunk/boost/system/error_code.hpp:176: warning: ‘boost::system::errno_ecat’ defined but not used ~/Boost/svn/trunk/boost/system/error_code.hpp:177: warning: ‘boost::system::native_ecat’ defined but not used
p.s. I'll apply your fixes soon - in a few hours most likely.
Thanks. Please remember that compiler warn about unused parameters and not necessary semi colons. Jens

Hi Jens, Applied your patch. Thanks! About the extra colons - my mistake - first I used classes, then moved to namespaces. Best, John #include <boost/logging/detail/fwd.hpp> @@ -42,10 +38,20 @@ #else +#ifdef BOOST_LOG_TSS_USE_CUSTOM // in case the user specified a custom class, maybe he specified its name as well #define BOOST_LOG_TSS_DEFAULT_CLASS BOOST_LOG_TSS_USE_CUSTOM + +#else + +// use internal implementation +#include <boost/logging/detail/tss/tss_impl.hpp> +#define BOOST_LOG_TSS_DEFAULT_CLASS = ::boost::logging::thread_specific_ptr + #endif +#endif + ----> note : no need, I do this on macros.hpp (define BOOST_LOG_TSS_USE_CUSTOM if none is defined) namespace boost { namespace logging { @@ -81,12 +87,5 @@ #endif // !BOOST_LOG_NO_TSS -- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

On Sat, Nov 10, 2007 at 06:42:50AM +0200, John Torjo wrote:
Applied your patch. Thanks!
Thanks, it was only a very very trivial one.
#else
+#ifdef BOOST_LOG_TSS_USE_CUSTOM // in case the user specified a custom class, maybe he specified its name as well #define BOOST_LOG_TSS_DEFAULT_CLASS BOOST_LOG_TSS_USE_CUSTOM + +#else + +// use internal implementation +#include <boost/logging/detail/tss/tss_impl.hpp> +#define BOOST_LOG_TSS_DEFAULT_CLASS = ::boost::logging::thread_specific_ptr + #endif
+#endif +
----> note : no need, I do this on macros.hpp (define BOOST_LOG_TSS_USE_CUSTOM if none is defined)
Compiling only boost/logging/macros.hpp with a trivial main() results in: In file included from ~/Boost/svn/logging/boost/logging/detail/ts/ts_resource.hpp:25, || from ~/Boost/svn/logging/boost/logging/detail/fwd.hpp:25, || from ~/Boost/svn/logging/boost/logging/macros.hpp:24, || from /tmp/testPDXvVD.cpp:1: ~/Boost/svn/logging/boost/logging/detail/tss/tss.hpp|58| error: expected '>' before 'BOOST_LOG_TSS_USE_CUSTOM' || In file included from ~/Boost/svn/logging/boost/logging/detail/fwd.hpp:25, || from ~/Boost/svn/logging/boost/logging/macros.hpp:24, || from /tmp/testPDXvVD.cpp:1: ~/Boost/svn/logging/boost/logging/detail/ts/ts_resource.hpp|220| error: wrong number of template arguments (1, should be 2) ~/Boost/svn/logging/boost/logging/detail/tss/tss.hpp|58| error: provided for 'template<class type, template<class> class thread_specific_ptr_type> struct boost::logging::tss_value' ~/Boost/svn/logging/boost/logging/detail/ts/ts_resource.hpp|293| error: wrong number of template arguments (1, should be 2) ~/Boost/svn/logging/boost/logging/detail/tss/tss.hpp|58| error: provided for 'template<class type, template<class> class thread_specific_ptr_type> struct boost::logging::tss_value' Please note that the error occurs from the include in line 24 of macros.hpp *before* you define BOOST_LOG_TSS_USE_CUSTOM. So any file included in macros.hpp depends itself from macros.hpp. Further error: ~/Boost/svn/logging/boost/logging/tags.hpp: In member function 'const tag_type& boost::logging::tag_holder<string_, param1, param2, param3, param4, param5, param6, param7, param8, param9, param10>::get_tag() const': ~/Boost/svn/logging/boost/logging/tags.hpp|93| error: there are no arguments to 'operator const tag_type&' that depend on a template parameter, so a declaration of 'operator const tag_type&' must be available ~/Boost/svn/logging/boost/logging/tags.hpp|93| error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) Jens

Compiling only boost/logging/macros.hpp with a trivial main() results in:
In file included from ~/Boost/svn/logging/boost/logging/detail/ts/ts_resource.hpp:25, || from ~/Boost/svn/logging/boost/logging/detail/fwd.hpp:25, || from ~/Boost/svn/logging/boost/logging/macros.hpp:24, || from /tmp/testPDXvVD.cpp:1: ~/Boost/svn/logging/boost/logging/detail/tss/tss.hpp|58| error: expected '>' before 'BOOST_LOG_TSS_USE_CUSTOM' || In file included from ~/Boost/svn/logging/boost/logging/detail/fwd.hpp:25, || from ~/Boost/svn/logging/boost/logging/macros.hpp:24, || from /tmp/testPDXvVD.cpp:1: ~/Boost/svn/logging/boost/logging/detail/ts/ts_resource.hpp|220| error: wrong number of template arguments (1, should be 2) ~/Boost/svn/logging/boost/logging/detail/tss/tss.hpp|58| error: provided for 'template<class type, template<class> class thread_specific_ptr_type> struct boost::logging::tss_value' ~/Boost/svn/logging/boost/logging/detail/ts/ts_resource.hpp|293| error: wrong number of template arguments (1, should be 2) ~/Boost/svn/logging/boost/logging/detail/tss/tss.hpp|58| error: provided for 'template<class type, template<class> class thread_specific_ptr_type> struct boost::logging::tss_value'
Please note that the error occurs from the include in line 24 of macros.hpp *before* you define BOOST_LOG_TSS_USE_CUSTOM. So any file included in macros.hpp depends itself from macros.hpp.
Ouch, thanks for pointing it out :P Fixed. Best, John -- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

On Mon, Nov 12, 2007 at 05:43:00PM +0200, John Torjo wrote:
Please note that the error occurs from the include in line 24 of macros.hpp *before* you define BOOST_LOG_TSS_USE_CUSTOM. So any file included in macros.hpp depends itself from macros.hpp.
Ouch, thanks for pointing it out :P Fixed.
Thanks, I attached another trivial patch (the last one?) Jens

Applied, thanks :) Best, John
On Mon, Nov 12, 2007 at 05:43:00PM +0200, John Torjo wrote:
Please note that the error occurs from the include in line 24 of macros.hpp *before* you define BOOST_LOG_TSS_USE_CUSTOM. So any file included in macros.hpp depends itself from macros.hpp.
Ouch, thanks for pointing it out :P Fixed.
Thanks, I attached another trivial patch (the last one?)
Jens
------------------------------------------------------------------------
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

Hi John, On Tue, Nov 13, 2007 at 11:06:29AM +0200, John Torjo wrote:
Applied, thanks :)
please avoid top posting. You know why, right? (Otherwise search the web for it.) I have not yet ported my code to use the new logger version but I nevertheless think the code compiles now clean on many systems. Great. John, you should improve your commits and the SVN log messages a little bit. If you recieve a patch you should e.g. commit it (more or less) unchanged and mention the submitter even with email address. I do not care about my stuff (it was too trivial and I expected that you clean the patches first) but it is e.g. very important for copyright issues. Once the code should be relicensed you have to contact all contributors or rewrite contributed code from scratch. So it would be also simpler to determine who introduced bugs ... Currently I think you work locally with another version control system or maybe even without to collect your stuff (which you call versions) before you commit. Probably the commits are done automatically once you start a special action? Please note that there is no need to set the date in the svn log. It's the task of Subversion to handle it. So I think it is OK to commit even smaller changes into repository, that's why a repository exists beside source tar balls :-) Thanks, Jens

Hi Jens,
Hi John,
On Tue, Nov 13, 2007 at 11:06:29AM +0200, John Torjo wrote:
Applied, thanks :)
please avoid top posting. You know why, right? (Otherwise search the web for it.)
I will ;)
I have not yet ported my code to use the new logger version but I nevertheless think the code compiles now clean on many systems. Great.
Cool!
John, you should improve your commits and the SVN log messages a little bit. If you recieve a patch you should e.g. commit it (more or less) unchanged and mention the submitter even with email address. I do not
Oh, did not know that.
Currently I think you work locally with another version control system or maybe even without to collect your stuff (which you call versions)
Not really. The thing is that I look at the patch, and see what your intent was - so I fix the code - perhaps in a different way, but to achieve the same results ;) That is, fixing the compile errors.
before you commit. Probably the commits are done automatically once you start a special action? Please note that there is no need to set the date in the svn log. It's the task of Subversion to handle it.
I know that ;) It's just simple for me to do it since I maintain it anyway in the changelog - and then, I copy/paste from there. It helps me to know the dates I've done changes and it helps me easily remember which version is on my site : http://torjo.com/log2/doc/html/page_changelog.html#changelog_cur_ver Thanks for all your help! Best, John -- http://John.Torjo.com -- C++ expert ... call me only if you want things done right

Am Freitag 09 November 2007 20:33:36 schrieb Maik Beckmann:
Can you spend some Makefiles/bjam files for building the samples?
From what I can read out of basic_usage.vcproj dir_spec.cpp file_statistics.cpp log.cpp main.cpp parse_file.cpp util.cpp
I don't speak bjam fluid, so just because lack of time here the CMakeLists.txt I used, for those who know CMake. <CMakeLists.txt> project(basic_usage) set(BOOST_ROOT /mnt/debian_sda/home/maik/workspace/boost) set(BOOST_SANDBOX_ROOT /mnt/debian_sda/home/maik/workspace/boost-sandbox) set(compiler gcc42) include_directories( ${BOOST_ROOT} ${BOOST_SANDBOX_ROOT}/logging ) link_directories( ${BOOST_ROOT}/stage/lib ) add_executable(basic_usage dir_spec.cpp file_statistics.cpp log.cpp main.cpp parse_file.cpp util.cpp ) target_link_libraries(basic_usage boost_thread-${compiler}-mt boost_filesystem-${compiler}-mt ) </CMakeLists.txt>
participants (4)
-
Jens Seidel
-
John Torjo
-
Maik Beckmann
-
Paul A Bristow