Boost logo

Boost Users :

Subject: Re: [Boost-users] [Boost.Log] Some few newbee questions
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-07-10 12:32:47


I'll try to answer from memory:

On Thu, Jul 4, 2013 at 4:51 PM, Ovanes Markarian <om_boost_at_[hidden]>wrote:

>
> 1. In my application I would like to start with the trivial logger and
> extend this logger with more options, i.e. attributes etc. Currently I see
> the following input when doing a trace:
>
> [2013-07-03 22:17:32.462265] [0x76f73180] [trace] thread_pool: creating 1 threads[2013-07-03 22:17:32.462303] [0x76f73180] [trace] thread_pool: created thread number: 1[2013-07-03 22:17:32.462312] [0x76f73180] [trace] thread_pool: all threads started[2013-07-03 22:17:32.462320] [0x76f73180] [trace] thread_pool: constructor finished
>
> My question is what is the second attribute? Thread id? As my code runs on
> a 64bit machine, that does not seem to be an address...
>
>
Yes it's the thread id. To check. just launch a thread manually using a
function that just do a log.

> 2. Is it possible to use a scoped logging with the trivial logger? I tried
> to do it as described in the example but see not output. How can I produce
> the output from the scoped logger?
>

Not sure about this one, I don't use scoped logging at the moment. If you
tried an example from the doc but it didn't do what you expected, then
report a bug.

> 3. In my example I wrote thread_pool prefix before each log entry. Can I
> do it automatically? How would I go on if I only have trivial logging?
>

I would not use trivial logging as soon as I want to customize the logging.
The reason is that trivial logging is a full setup which is easy to
reproduce and easier to modify if you set it up manually.
So I encourage you to decide how you want to log (for now) and setup
formatting and sinks manually. It's really not hard,
just a bit alien at first to write.

Joel Lamotte



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net