www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2002/05/04/08:21:39

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <http://sources.redhat.com/lists.html#faqs>
Mail-Followup-To: cygwin-apps AT cygwin DOT com
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
content-class: urn:content-classes:message
MIME-Version: 1.0
Subject: new logging structure for setup
X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3
Date: Sat, 4 May 2002 22:21:30 +1000
Message-ID: <FC169E059D1A0442A04C40F86D9BA7600C5FBD@itdomain003.itdomain.net.au>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: "Cygwin-Apps" <cygwin-apps AT sources DOT redhat DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g44CLcG31405

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019