This patch adds a new configuration setting called "FilenamePrototype"
which is honored by the FileLog and FileStore classes. It allows you
specify the format of the filenames created by these classes so you
can include things like datestamps and possibly omit parts of the
session ID that you don't care about.
FilenamePrototype is taken to be a string of characters with
brace-delimited tokens. The brace-delimited tokens are replaced with
the appropriate values for the session in question. By default,
FilenamePrototype is:
{BeginString}-{SenderCompID}-{TargetCompID}{-SessionQualifier}
which retains the current filename formatting standards. Tokens in
braces will be replaced by the corresponding value from the SessionID.
If the replacement value is blank (e.g. like SessionQualifier usually
is), the entire brace-delimited string is removed from the resulting
filename. This way "{-SessionQualifier}" either expands to
"-some_session_qualifier" or "".
The resulting stub filename is also run through the POSIX "strftime"
function so you can use any valid strftime escapes in your
FilenamePrototype string. You'll need to be careful so that the
filename will be the same for the duration of the session, though.
For example, if you have a week-long session, you should not use
%Y%m%d in the FilenamePrototype since this would yield different
filenames every day.
My main reason for adding this code was to add a date-stamp to the log
and store files we have to make archiving simpler and eliminate the
possibility that data can be carried over from one day to the next. I
hope others find it useful.
--
Caleb Epstein
cal...@gm...
|