Boost logo

Boost :

From: John Torjo (john.groups_at_[hidden])
Date: 2008-02-06 03:59:40


> Hi John,
>
> Paused for food. A picnic with friends over the local surf break, on a balmy
> night in the South Pacific. Ah but back to more important things ;-)
>
>
That sounds pretty cool ;)
>
>> The last representation : what does "/matching_profile" mean?
>>
>
> It was intended to be an example of an encoded variable reference. The
> last component being the supplied variable name.
>
> No, like this (choice of identifier not helpful);
>
> unsigned int matching_profile;
>
>
As a side-note - you do know that if you truly want this: "After
completion there were <3!unsigned int/matching_profile> leftovers",
you'll need a macro somewhere, like:

L_ << "After completion there were " << V_(macthing_profile) << "
leftovers";

However, there should be a quite different solution to your problem:
- when logging, automatically log the filename & line (or at least some
unique ID from which you can get them) . This is possible with the
current version of the lib.
- then, have a viewer that parses both a log, and the source code for
each logged line. Then, it can match a certain logged message with the
actual line of C++ code. It can then interpret it.

Thus, even if you have:

After completion there were 3 leftovers and ...

It will know 3 is of type "unsigned int", and is called matching_profile.

>> About "event involving a time, unique id, list of ..." - could we be
>> talking about tags?
>> I believe those should actually be what you want:
>> http://torjo.com/log2/doc/html/namespaceboost_1_1logging_1_1tag.html
>>
>
> Think it's fair to say no. While technically I suspect tags could be applied
> to the problem at best it would be unwieldy.
>
> The crucial piece seemed to be the declaration of the tags macro where
> the log message is decorated with information from the runtime context.
> This might be on a per-module or global basis.
>
> I'm guessing that in my circumstance there would be a set of declared tags
> for each
> event type.
>
>
Could you give me a specific example? Because we're talking in too
generic terms ;)

Best,
John

-- 
http://John.Torjo.com -- C++ expert
http://blog.torjo.com
... call me only if you want things done right

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