This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
new logging structure for setup
- From: "Robert Collins" <robert dot collins at itdomain dot com dot au>
- To: "Cygwin-Apps" <cygwin-apps at sources dot redhat dot com>
- Date: Sat, 4 May 2002 22:21:30 +1000
- Subject: new logging structure for setup
I've turned the global log() function into a C++ stream.
For a new binary, the method
LogSingleton::SetInstance() must be called with a concrete object to
setup logging. After that, you can log with
==
log (LOG_TIMESTAMP) << "foo bar " << anInt << aString << endLog;
==
The log() and the endLog; are compulsory.
You can also use the following syntax:
log (LOG_TIMESTAMP) << "foo bar ";
log (LOG_TIMESTAMP) << anInt;
log (LOG_TIMESTAMP) << endLog;
The current log() implementation now uses the LogSingleton
implementation, which for setup.exe uses a concrete class LogFile. Once
no code uses the old syntax, it will be removed.
If you are building setup.exe code base using apps, LogFile may be
appropriate if you are building a GUI app. It's probably not appropriate
if you are not building a GUI app.
Rob