什么是升压日志,如何得到它,怎样建设 [英] What is boost log, how to get it and how to build it

查看:165
本文介绍了什么是升压日志,如何得到它,怎样建设的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我听说升压日志的好东西。这个声称它的存在:

So I heard good things about boost log. This claims its existence:

<一个href=\"http://boost-log.sourceforge.net/libs/log/doc/html/index.html\">http://boost-log.sourceforge.net/libs/log/doc/html/index.html

这是教程:

<一个href=\"http://boost-log.sourceforge.net/libs/log/doc/html/log/tutorial.html#log.tutorial.trivial\">http://boost-log.sourceforge.net/libs/log/doc/html/log/tutorial.html#log.tutorial.trivial

不过,升压日志不刺激的一部分。因此,不能在常规升压分支。

However, boost log is not part of boost. Hence not in the regular boost branch.

人们可以从这里单独下载升压日志:

One can download boost log separately from here:

http://sourceforge.net/projects/boost-log/

我可能只是太没有经验,但我发现安装说明很可怜。尽管如此,下载和复制后文件夹提振和lib进入升压文件夹,我可以运行的引导和的bjam。这种失败与Boost.Filesystem的版本错误,类似于在这里提到的那些:

I might just be too inexperienced, but I find the installation instructions very poor. Nonetheless, after downloading and copying the folders boost and lib into the boost folder, I can run bootstrap and bjam. This fails with errors relating to Boost.Filesystem versions, similar to the ones mentioned here:

<一个href=\"http://boost.2283326.n4.nabble.com/Boost-Log-compilation-on-msvc-2010-fail-td3488502.html\">http://boost.2283326.n4.nabble.com/Boost-Log-compilation-on-msvc-2010-fail-td3488502.html

从安德鲁Semashev(在上面的链接)的建议是请使用Boost.Log V2(从SVN主干)。

The recommendation from Andrew Semashev (in above link) is to "Please use Boost.Log v2 (from SVN trunk)."

看着<一个href=\"https://boost-log.svn.sourceforge.net/svnroot/boost-log\">https://boost-log.svn.sourceforge.net/svnroot/boost-log,我只能看到第1版。

Looking at https://boost-log.svn.sourceforge.net/svnroot/boost-log, I can only see version 1.

http://svn.boost.org/svn/boost/sandbox/ 看,我可以找到约翰Torjo提振记录V2。然而,仅仅从语法可能不是安德鲁Semashev在谈论升压日志V2。

Looking at http://svn.boost.org/svn/boost/sandbox/, I can find boost logging v2 by John Torjo. However, just from the syntax that might not be the boost log v2 that Andrew Semashev is talking about.

看到我花了太多时间在这了,我想我会得到一些帮助,也许其他一些人可能会从这篇文章,答案获利,并拯救自己一些时间。我不认为它已经回答过了,喜欢这些改变我的答案应该。

Seeing that I spend way too many hours on this already, I figured I'd get some help, and maybe some other people might profit from this post and the answers and save themselves some time. I don't think it has been answered before, and answers like these change I supposed.

所以,这里有云:什么是安德鲁Semashev在谈论升压日志v2的?它是一样的约翰Torjo的?如果没有,在那里我可以找到它?而且我怎么建立呢?

So, here goes: What is boost log v2 that Andrew Semashev is talking about? Is it the same as John Torjo's? If not, where I can find it? And how do I build it?

感谢

P.S。我应该提到这是在Windows上使用Visual Studio防爆preSS 2010

P.S. I should mention this is on Windows with Visual Studio Express 2010

P.P.S。猜测第2版,这显然是刚刚SVN的,也有问题,但与这条线(见下文Sergio的回答)

P.P.S. Guess "version 2", which is apparently just the SVN, also has problems, but with this line (see Sergio's answer below)

&LT;&工具GT; MSVC:其中;确定&GT; BOOST_FILESYSTEM_VERSION = 2

在bjam的文件,至少我可以通过编译。但是,此文件

in the bjam file at least I can compile. However, this file

#include <boost/log/trivial.hpp>
int main(int, char*[])
{
    BOOST_LOG_TRIVIAL(trace) << "A trace severity message";
    BOOST_LOG_TRIVIAL(debug) << "A debug severity message";
    BOOST_LOG_TRIVIAL(info) << "An informational severity message";
    BOOST_LOG_TRIVIAL(warning) << "A warning severity message";
    BOOST_LOG_TRIVIAL(error) << "An error severity message";
    BOOST_LOG_TRIVIAL(fatal) << "A fatal severity message";
}

直出教程,虽然现在编译和链接,不产生任何输出...

straight out of the tutorial, albeit now compiling and linking, doesn't produce any output...

推荐答案

升压日志V2仅仅是你通过查看后备箱得到什么,按什么安德烈说,在您链接的帖子。

boost log v2 is simply what you get by checking out trunk, according to what Andrey says in the post you link.

事实上,似乎这个版本太多已经得到了反编译的boost ::文件系统v3的问题。

indeed, it seems that this version too has got problems compiling against boost::filesystem v3.

如果这也是你的情况下,一个解决方法是在编译后加入

if this is also your case, one workaround is compiling after adding

<define>BOOST_FILESYSTEM_VERSION=2

到的Jamfile。

to the jamfile.

如果这不起作用的话,检查是否正在构建的库的单线程还是多线程版本。多threadred升压日志应(按安德烈)更考验。

if this does not work, then, check whether you are building a single threaded or multi-threaded version of the libraries. multi-threadred boost-log should be more tested (according to Andrey).

希望这可以帮助...我还没有尝试过...

hope this helps... I have not tried it...

编辑:

在哪里添加?

我想将它添加到要求部分升压日志/库/日志/编译/ Jamfile.v2 共享小节:

I would add it to the requirements section of boost-log/libs/log/build/Jamfile.v2, shared subsection:

project boost/log
    : source-location ../src
    : requirements
       <link>shared:<define>BOOST_LOG_DLL
       <link>shared:<define>BOOST_FILESYSTEM_VERSION=2

编辑:从Cookie的评论, BOOST_FILESYSTEM_VERSION = 2 应指定为

       <link>msvc:<define>BOOST_FILESYSTEM_VERSION=2

不是共享

这篇关于什么是升压日志,如何得到它,怎样建设的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆