Boost logo

Boost :

From: Paul A Bristow (pbristow_at_[hidden])
Date: 2005-11-09 14:03:56


 

| -----Original Message-----
| From: boost-bounces_at_[hidden]
| [mailto:boost-bounces_at_[hidden]] On Behalf Of John Torjo
| Sent: 08 November 2005 21:14
| To: boost_at_[hidden]
| Subject: Re: [boost] [Review] The review of the Boost.Logging
| library startstoday, November 7th
|
| Paul A Bristow wrote:
| >
| >
| > | -----Original Message-----
| > | From: boost-bounces_at_[hidden]
| > | [mailto:boost-bounces_at_[hidden]] On Behalf Of Hartmut Kaiser
| > | Sent: 06 November 2005 20:02
| > | To: boost_at_[hidden]
| > | Subject: [boost] [Review] The review of the Boost.Logging
| I'm posting my 'bin' directory online:

| http://www.torjo.com/code/bin.zip

Thanks,
| It contains binaries for vc7.1 and vc8.0. I have a very old
| 8.0 version,
| so there could be problems on your machine.
|
| >
| > Could these be provided ready built for VS 7.1 and 8.0,
| > (For the convenience of the idle/incompetent

Still useful IMO, and similarly for other libraries, considering the work
involved for developers, it will encourage more people to use Boost.
Building libraries is still a hurdle.

| In addition to the posted bin.zip file,
| to build the log lib, you could do either of:
| - copy the library files into your BOOST_ROOT directory,

 but using the requested file to link (1_32??) doesn't work with my 1_33 and
8.0 beta2. Not unexpected :-(

| - get started by using one of the examples provided by the library.
| You could start with the 'basic_usage' example, or

| - include the source files into your projects -
| it's just 3 source files,

log_manager.cpp
log.cpp
functions.cpp

#define BOOST_LOG_NO_LIB

sounds good ...

BUT

i:\boost_root\libs\log\src\functions.cpp(53) : error C2664:
'OutputDebugStringW' : cannot convert parameter 1 from 'const char *' to
'LPCWSTR'

Adding a (LPCWSTR) makes this compile and link OK.

But then re-compile your \examples\simple example fails to compile

functions.cpp
..\..\..\src\functions.cpp(53) : error C2664: 'OutputDebugStringA' : cannot
convert parameter 1 from 'LPCWSTR' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires
reinterpret_cast, C-style cast or function-style cast

So I tried (LPCSTR) (quickest bodge) and with autorun works thus:

Autorun
"\\hetp3\i$\boost_root\libs\log\examples\simple\vc71\Release\vc71.exe"
17:41:18 [app] [Thread 2200] pre-start - this gets logged too!
17:41:18 [app.dbg] debug pre-start - this gets logged too!
17:41:18 [app] [Thread 2200] testing1-2-3
17:41:18 [app.dbg] this is a debug message, i=1
17:41:18 I just wanted to tell you something....
17:41:18 [app.warn] Logged-on Users approach max. limit
17:41:18 [app.err] Too many users!
17:41:18 Creating main window
17:41:18 A debug msg coming from {charts} module
17:41:18 Destroying main window
17:41:18 [app] [Thread 2200] However, this msg. will
17:41:18 [app.dbg] this will be written - this log just got enabled
17:41:18 [app.err] this will be written - all logs are enabled
17:41:18 [app.dbg] this will be written
17:41:18 a simple info

:-)

Using CTL F5 to start a console window...

CMD.EXE was started with
'\\hetp3\i$\boost_root\libs\log\examples\simple\vc71' a
s the current directory path.

  UNC paths are not supported. <<<<<<<<<<<<<<<<< Why not?

  Defaulting to Windows directory.
17:44:00 [app] [Thread 2188] pre-start - this gets logged too!
17:44:00 [app.dbg] debug pre-start - this gets logged too!
17:44:00 [app] [Thread 2188] testing1-2-3
17:44:00 [app.dbg] this is a debug message, i=1
17:44:00 I just wanted to tell you something....
17:44:00 [app.warn] Logged-on Users approach max. limit
17:44:00 [app.err] Too many users!
17:44:00 Creating main window
17:44:00 A debug msg coming from {charts} module
17:44:00 Destroying main window
17:44:00 [app] [Thread 2188] However, this msg. will
17:44:00 [app.dbg] this will be written - this log just got enabled
17:44:00 [app.err] this will be written - all logs are enabled
17:44:00 [app.dbg] this will be written
17:44:00 a simple info
Press any key to continue . . .

And my out.txt file is in c:\winnt - somewhat to my surprise.

I did quite a bit of fumbling to get the basic example working, starting
right scratch as a complete novice.

As ever, using macros, the error messages swiftly become inscrutable.

Why would one want to create a file define.h just to hold one (or perhaps
two) statements?

It is just impossible to write documentation if you are the code author!

(I find the greyed out code MOST irritating. - I don't see why one should
want to change the background at all - it just decreases legibility. A very
slight background is ample and MUCH better IMO -
.code { width: 100%; border: none; background-color: #f0f0f0; } or #f0f0fa ?

A list of macros and their function would be helpful.

I have, for example,

#define BOOST_LOG_WIN32
in init.cpp to activate

#ifdef BOOST_LOG_WIN32
    manipulate_logs("DEBUG").add_appender(write_to_dbg_wnd );
#endif

and this works, writing to the console window.

But the line

    manipulate_logs("app").add_appender(write_to_file("Test_log_out.txt") );

doesn't seem to create the file I expect, anywhere.

I would expect Test_log_out.txt to be in project \debug or \release?

Or in c:\winnt???

While I RTFM, perhaps you can advise on progress so far.

Thanks

Paul

-- 
Paul A Bristow
Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB
Phone and SMS text +44 1539 561830, Mobile and SMS text +44 7714 330204
mailto: pbristow_at_[hidden]  www.hetp.u-net.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk