boost-log

Boost-log linker error

天涯浪子 提交于 2019-11-28 14:15:00
i've downloaded and builded Boost 1.55 from source. I'm trying to use Boost-log. In basic case ( http://boost-log.sourceforge.net/libs/log/doc/html)/log/tutorial.html#log.tutorial.trivial it's working fine without any problems, but when i try to use some more advanced features(like this - http://boost-log.sourceforge.net/libs/log/example/doc/tutorial_fmt_stream.cpp ) i'm getting this error: main.obj : error LNK2019: unresolved external symbol "void __cdecl boost::filesystem::path_traits::convert(char const *,char const *,class std::basic_string,class std::allocator> &,class std::codecvt const

Boost.Log - how to configure a text sink backend to append to rotated files

半世苍凉 提交于 2019-11-28 09:41:36
I have a sinks::text_file_backend sink. Say I already have a few rotated log files: myLog001.log, myLog002.log and so on I want the sink to keep writing to the last rotated file - myLog002.log, append to its contents and continue rotation from there on. I have only managed to find keywords::open_mode = append but this only appends on top of the existing myLogX files, making them larger and of course very hard to read. Can this be done in Boost.Log? That functionality is built in to the text sink, and the documentation includes an example to set the file-name pattern and rules for rotating at

Log file is not getting created

二次信任 提交于 2019-11-28 06:54:37
问题 I need a global logger that I can use across multiple classes in my project. I want to have logger settings in an ini file. I start following example here and combined it with some suggestions at my earlier question here. My Logger.h is as follows. #pragma once #include <boost/log/common.hpp> #include <boost/log/attributes.hpp> #include <boost/log/utility/setup/from_stream.hpp> #include <boost/regex.hpp> #include <boost/log/expressions.hpp> #include <boost/log/sources/global_logger_storage

Problems Linking boost log 1_60 with MinGw on Windows 7

风格不统一 提交于 2019-11-28 04:45:35
问题 On upgrading to boost 1.60.0 some applications are failing to link with boost log when built with MinGw 4.9.2 on Windows 7. I get the following linker errors: undefined reference to `_imp___ZN5boost3log9v2_mt_nt67trivial6logger3getEv' undefined reference to `_imp___ZN5boost3log9v2_mt_nt63aux15stream_providerIcE17allocate_compoundERNS1_6recordE' undefined reference to `_imp___ZN5boost3log9v2_mt_nt63aux25unhandled_exception_countEv' undefined reference to `_imp___ZN5boost3log9v2_mt_nt611record

Boost.log: How to prevent the output will be duplicated to all added streams when it uses the add_file_log() function?

醉酒当歌 提交于 2019-11-28 00:35:55
问题 I use the add_file_log() function to initialize a logging sink that stores log records into a text file. When I define several sinks, I have observed: a file is created for each sink. the output is copied to all files. This is my logger: class logger { public: logger(const logger&) =delete; logger(logger&&) =delete; logger& operator=(const logger&) =delete; logger& operator=(logger&&) =delete; static logger& get_instance( const std::string& file, bool console ) { boost::log::register_simple

Boost.Log with CMake causing undefined reference error

喜夏-厌秋 提交于 2019-11-27 20:53:56
问题 I am trying to use the new Boost.Log library in a project I am working on. The project is built with CMake. I am receiving link errors claiming that the linker has come across undefined references to Boost.Log Linking CXX executable main CMakeFiles/main.dir/main.cpp.o: In function `main': main.cpp:(.text+0x30): undefined reference to `boost::log::v2s_mt_posix::trivial::logger::get()' I have a simple hello world test that fails with these errors. If I am linking against the Boost.Log libraries

Cast a boost::log::expressions::attr< std::string > to std::string

こ雲淡風輕ζ 提交于 2019-11-27 16:53:40
问题 While using Boost.Log, I am trying to keep my TimeStamp formatter such as: logging::add_file_log ( keywords::file_name = "my.log", keywords::format = ( expr::stream << expr::format_date_time< boost::posix_time::ptime >("TimeStamp", "%Y-%m-%d %H:%M:%S") << "," << expr::attr< int >("Line") << " " << expr::attr< std::string >("File") << " " << logging::trivial::severity << " - " << expr::smessage ) ); It is said that I cannot use the other form of formatter since I'll have much difficulties

Use channel hiearchy of Boost.Log for severity and sink filtering

不问归期 提交于 2019-11-27 05:22:56
I have been studying Boost.Log for a while and I believe now is the time for me to transition my code base from log4cxx to Boost.Log. I believe the design and implementation of Boost.Log will significantly improve my code maintenance and usage. I know the Boost.Log FAQ has a page that says As for hierarchical loggers, there is no need for this feature in the current library design. One of the main benefits it provides in log4j is determining the appenders (sinks, in terms of this library) in which a log record will end up. This library achieves the same result by filtering. I understand the

Use channel hiearchy of Boost.Log for severity and sink filtering

与世无争的帅哥 提交于 2019-11-26 12:48:02
问题 I have been studying Boost.Log for a while and I believe now is the time for me to transition my code base from log4cxx to Boost.Log. I believe the design and implementation of Boost.Log will significantly improve my code maintenance and usage. I know the Boost.Log FAQ has a page that says As for hierarchical loggers, there is no need for this feature in the current library design. One of the main benefits it provides in log4j is determining the appenders (sinks, in terms of this library) in