About log example in visual studio 2008

Hi, Experts, I was trying to run the log basic usage (libs/log/example/basic_usage/main.cpp) example in visual studio. And it crashed at line logging::add_console_log(std::clog, keywords::format = "%TimeStamp%: %Message%"); Stopped at // For compatibility with Boost.Log v1 we recognize %_% as the message attribute name const std::size_t len = end - begin; if (std::char_traits< char_type
::length(constants::message_text_keyword()) == len && std::char_traits< char_type ::compare(constants::message_text_keyword(), begin, len) == 0) { m_AttrName = log::aux::default_attribute_names::message(); } else { m_AttrName = attribute_name(log::aux::to_narrow(string_type(begin, end))); }
Anybody has successfully run the example? Thanks! Regards, Triston

AMDG On 03/18/2014 10:59 PM, Xiande Cao wrote:
I was trying to run the log basic usage (libs/log/example/basic_usage/main.cpp) example in visual studio. And it crashed at line logging::add_console_log(std::clog, keywords::format = "%TimeStamp%: %Message%");
Stopped at <snip>
Anybody has successfully run the example?
It works fine for me with VC9 and VC11. What version of Boost are you using? What is the error that you get? In Christ, Steven Watanabe

Thank you, Steven for your reply. The version I used is 1_55_0. And I also tried the log 2 version. Neither works for me. I compiles OK. It just crashed. Thanks! Triston On Wed, Mar 19, 2014 at 8:42 AM, Steven Watanabe <watanabesj@gmail.com>wrote:
AMDG
On 03/18/2014 10:59 PM, Xiande Cao wrote:
I was trying to run the log basic usage (libs/log/example/basic_usage/main.cpp) example in visual studio. And it crashed at line logging::add_console_log(std::clog, keywords::format = "%TimeStamp%: %Message%");
Stopped at <snip>
Anybody has successfully run the example?
It works fine for me with VC9 and VC11. What version of Boost are you using? What is the error that you get?
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Hi, Stev, Here is where the program stops, In "formater_parser.cpp file const std::size_t len = end - begin; if (std::char_traits< char_type >::length(constants::message_text_keyword()) == len && std::char_traits< char_type >::compare(constants::message_text_keyword(), begin, len) == 0) { m_AttrName = log::aux::default_attribute_names::message(); } else { ???--> m_AttrName = attribute_name(log::aux::to_narrow(string_type(begin, end))); } } Here is the call stack, > cvsie.exe!boost::log::v2s_mt_nt5::`anonymous namespace'::formatter_parser<char>::on_attribute_name(const char * begin=0x000000013f259a81, const char * end=0x000000013f259a8a) Line 359 + 0x4d bytes C++ cvsie.exe!boost::log::v2s_mt_nt5::`anonymous namespace'::formatter_parser<char>::parse(const char * & begin=0x000000013f259a80, const char * end=0x000000013f259a96) Line 225 C++ cvsie.exe!boost::log::v2s_mt_nt5::parse_formatter<char>(const char * begin=0x000000013f259a80, const char * end=0x000000013f259a96) Line 436 C++ cvsie.exe!boost::log::v2s_mt_nt5::parse_formatter<char>(const char * str=0x000000013f259a80) Line 207 + 0x22 bytes C++ cvsie.exe!boost::log::v2s_mt_nt5::aux::acquire_formatter<char>(const char * formatter=0x000000013f259a80) Line 82 + 0xf bytes C++ cvsie.exe!boost::log::v2s_mt_nt5::aux::setup_formatter<boost::log::v2s_mt_nt5::sinks::synchronous_sink<boost::log::v2s_mt_nt5::sinks::basic_text_ostream_backend<char> >,boost::parameter::aux::tagged_argument<boost::log::v2s_mt_nt5::keywords::tag::format,char const [23]> >(boost::log::v2s_mt_nt5::sinks::synchronous_sink<boost::log::v2s_mt_nt5::sinks::basic_text_ostream_backend<char> > & s={...}, const boost::parameter::aux::tagged_argument<boost::log::v2s_mt_nt5::keywords::tag::format,char const [23]> & args={...}, boost::mpl::bool_<0> __formal={...}) Line 107 + 0x1e bytes C++ cvsie.exe!boost::log::v2s_mt_nt5::aux::add_console_log<char,boost::parameter::aux::tagged_argument<boost::log::v2s_mt_nt5::keywords::tag::format,char const [23]> >(std::basic_ostream<char,std::char_traits<char> > & strm={...}, const boost::parameter::aux::tagged_argument<boost::log::v2s_mt_nt5::keywords::tag::format,char const [23]> & args={...}) Line 79 C++ cvsie.exe!boost::log::v2s_mt_nt5::add_console_log<char,boost::parameter::aux::tagged_argument<boost::log::v2s_mt_nt5::keywords::tag::format,char const [23]> >(std::basic_ostream<char,std::char_traits<char> > & strm={...}, const boost::parameter::aux::tagged_argument<boost::log::v2s_mt_nt5::keywords::tag::format,char const [23]> & arg1={...}) Line 136 + 0x14 bytes C++ cvsie.exe!main(int argc=1, char * * argv=0x0000000000248890) Line 82 + 0x32 bytes C++ cvsie.exe!__tmainCRTStartup() Line 586 + 0x19 bytes C cvsie.exe!mainCRTStartup() Line 403 C The error shows: Unhandled exception at 0x000000013f146b63 in cvsie.exe: 0xC0000005: Access violation reading location 0x0000000000000070. Thanks! Regards, Triston On Wed, Mar 19, 2014 at 8:42 AM, Steven Watanabe <watanabesj@gmail.com>wrote: > AMDG > > On 03/18/2014 10:59 PM, Xiande Cao wrote: > > > > I was trying to run the log basic usage > > (libs/log/example/basic_usage/main.cpp) example in visual studio. And it > > crashed at line > > logging::add_console_log(std::clog, keywords::format = "%TimeStamp%: > > %Message%"); > > > > Stopped at > > <snip> > > > > Anybody has successfully run the example? > > > > It works fine for me with VC9 and VC11. What version of > Boost are you using? What is the error that you get? > > In Christ, > Steven Watanabe > > > _______________________________________________ > Boost-users mailing list > Boost-users@lists.boost.org > http://lists.boost.org/mailman/listinfo.cgi/boost-users >

AMDG On 03/19/2014 11:13 AM, Xiande Cao wrote:
Here is where the program stops, In "formater_parser.cpp file const std::size_t len = end - begin; if (std::char_traits< char_type
::length(constants::message_text_keyword()) == len && std::char_traits< char_type ::compare(constants::message_text_keyword(), begin, len) == 0) { m_AttrName = log::aux::default_attribute_names::message(); } else { ???--> m_AttrName = attribute_name(log::aux::to_narrow(string_type(begin, end))); } }
I can't reproduce this. I've tried (with 1.55) cd libs\log\example\basic_usage b2 variant=debug,release link=static,shared threading=single,multi msvc-9.0express msvc-11.0/architecture=x86/address-model=32,64 and everything seems to be okay. (I changed the target type from exe to unit-test so that it would run the example)
Here is the call stack,
cvsie.exe!boost::log::v2s_mt_nt5::`anonymous namespace'::formatter_parser<char>::on_attribute_name(const char * begin=0x000000013f259a81, const char * end=0x000000013f259a8a) Line 359 + <snip> The error shows: Unhandled exception at 0x000000013f146b63 in cvsie.exe: 0xC0000005: Access violation reading location 0x0000000000000070.
Looks like a null pointer. Can you figure out which variable is null? It obviously isn't either of the arguments. What about "this?" In Christ, Steven Watanabe

Hi, Stev, Thanks for your reply and help. I don't know. But I guess it might me the problem of the lib file I linked. I linked libboost_log-vc90-mt-1_55.lib file which is build on my machine. I will try another machine to see what goes wrong because all the example case for log failed on my machine. Again, Thanks a lot. I will let you know when it is done. Best regards, Triston On Thu, Mar 20, 2014 at 10:30 AM, Steven Watanabe <watanabesj@gmail.com>wrote:
AMDG
On 03/19/2014 11:13 AM, Xiande Cao wrote:
Here is where the program stops, In "formater_parser.cpp file const std::size_t len = end - begin; if (std::char_traits< char_type
::length(constants::message_text_keyword()) == len && std::char_traits< char_type ::compare(constants::message_text_keyword(), begin, len) == 0) { m_AttrName = log::aux::default_attribute_names::message(); } else { ???--> m_AttrName = attribute_name(log::aux::to_narrow(string_type(begin, end))); } }
I can't reproduce this. I've tried (with 1.55) cd libs\log\example\basic_usage b2 variant=debug,release link=static,shared threading=single,multi msvc-9.0express msvc-11.0/architecture=x86/address-model=32,64
and everything seems to be okay. (I changed the target type from exe to unit-test so that it would run the example)
Here is the call stack,
cvsie.exe!boost::log::v2s_mt_nt5::`anonymous namespace'::formatter_parser<char>::on_attribute_name(const char * begin=0x000000013f259a81, const char * end=0x000000013f259a8a) Line 359
<snip> The error shows: Unhandled exception at 0x000000013f146b63 in cvsie.exe: 0xC0000005: Access violation reading location 0x0000000000000070.
Looks like a null pointer. Can you figure out which variable is null? It obviously isn't either of the arguments. What about "this?"
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Hi, Steve, I tried different version of the library. All did not work. It turns out that I have to use the libboost_log-vc90-s-1_55.lib instead of libboost_log-vc90-mt-1_55.lib. Thanks! Regards, Triston On Thursday, March 20, 2014, Xiande Cao <xiande.cao@gmail.com> wrote:
Hi, Stev,
Thanks for your reply and help. I don't know. But I guess it might me the problem of the lib file I linked. I linked libboost_log-vc90-mt-1_55.lib file which is build on my machine. I will try another machine to see what goes wrong because all the example case for log failed on my machine. Again, Thanks a lot. I will let you know when it is done.
Best regards,
Triston
On Thu, Mar 20, 2014 at 10:30 AM, Steven Watanabe <watanabesj@gmail.com<javascript:_e(%7B%7D,'cvml','watanabesj@gmail.com');>
wrote:
AMDG
On 03/19/2014 11:13 AM, Xiande Cao wrote:
Here is where the program stops, In "formater_parser.cpp file const std::size_t len = end - begin; if (std::char_traits< char_type
::length(constants::message_text_keyword()) == len && std::char_traits< char_type ::compare(constants::message_text_keyword(), begin, len) == 0) { m_AttrName = log::aux::default_attribute_names::message(); } else { ???--> m_AttrName = attribute_name(log::aux::to_narrow(string_type(begin, end))); } }
I can't reproduce this. I've tried (with 1.55) cd libs\log\example\basic_usage b2 variant=debug,release link=static,shared threading=single,multi msvc-9.0express msvc-11.0/architecture=x86/address-model=32,64
and everything seems to be okay. (I changed the target type from exe to unit-test so that it would run the example)
Here is the call stack,
cvsie.exe!boost::log::v2s_mt_nt5::`anonymous namespace'::formatter_parser<char>::on_attribute_name(const char * begin=0x000000013f259a81, const char * end=0x000000013f259a8a) Line 359 + <snip> The error shows: Unhandled exception at 0x000000013f146b63 in cvsie.exe: 0xC0000005: Access violation reading location 0x0000000000000070.
Looks like a null pointer. Can you figure out which variable is null? It obviously isn't either of the arguments. What about "this?"
In Christ, Steven Watanabe
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org<javascript:_e(%7B%7D,'cvml','Boost-users@lists.boost.org');> http://lists.boost.org/mailman/listinfo.cgi/boost-users
-- Triston Xiande Cao
participants (2)
-
Steven Watanabe
-
Xiande Cao