[Boost.Log] Some few newbee questions

Hi *, Thanks for the really great logging library. Just used it a bit and was amazed how useful and easy to use it was. As I start using it more and more I have some questions... 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... 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? 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? May be I misunderstand some concepts, like how to use multiple loggers and connect them with each other? Any help is very appreciated. Thanks, Ovanes

Anyone, can answer that?
On Thu, Jul 4, 2013 at 4:51 PM, Ovanes Markarian
Hi *,
Thanks for the really great logging library. Just used it a bit and was amazed how useful and easy to use it was. As I start using it more and more I have some questions...
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...
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? 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?
May be I misunderstand some concepts, like how to use multiple loggers and connect them with each other? Any help is very appreciated.
Thanks, Ovanes

I'll try to answer from memory:
On Thu, Jul 4, 2013 at 4:51 PM, Ovanes Markarian
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
participants (2)
-
Klaim - Joël Lamotte
-
Ovanes Markarian