
On Tue, 15 Feb 2005 12:00:15 -0500, John Eddy <johneddy@eng.buffalo.edu> wrote:
2. Logging with timestamp automatically prefixed. Do you have something pre-built for this? If not, can you show what code I have to write to implement it.
There is a "helper" for automatically putting a timestamp into an entry. There are also a number of pre-existing entry types that are implementing that helper and of course, I can create any others that you might like. Below is an example of an entry that holds only a timestamp along with any other text supplied to it. The constructor of the entry takes a boost::posix_time::ptime object as the stamp (the default value is the current time) and any leading text that you wish to associate with the entry.
I think associating the format more directly with the output "device" (e.g. the logger) makes more sense. Its a pretty rare case that you'd want to log a timestamp with one message and not *every* message. -- Caleb Epstein caleb dot epstein at gmail dot com