1 // Module:  Log4CPLUS
 2 // File:    consoleappender.h
 3 // Created: 6/2001
 4 // Author:  Tad E. Smith
 5 //
 6 //
 7 // Copyright (C) Tad E. Smith  All rights reserved.
 8 //
 9 // This software is published under the terms of the Apache Software
10 // License version 1.1, a copy of which has been included with this
11 // distribution in the LICENSE.APL file.
12 //
13 
14 /** @file */
15 
16 #ifndef _LOG4CPLUS_CONSOLE_APPENDER_HEADER_
17 #define _LOG4CPLUS_CONSOLE_APPENDER_HEADER_
18 
19 #include <log4cplus/config.h>
20 #include <log4cplus/appender.h>
21 
22 namespace log4cplus {
23     /**
24      * ConsoleAppender appends log events to <code>System.out</code> or
25      * <code>System.err</code> using a layout specified by the
26      * user. The default target is <code>System.out</code>.
27      */
28     class LOG4CPLUS_EXPORT ConsoleAppender : public Appender {
29     public:
30       // Ctors
31         ConsoleAppender(bool logToStdErr = false, bool immediateFlush = false);
32         ConsoleAppender(const log4cplus::helpers::Properties properties);
33 
34       // Dtor
35         ~ConsoleAppender();
36 
37       // Methods
38         virtual void close();
39 
40     protected:
41         virtual void append(const spi::InternalLoggingEvent& event);
42 
43       // Data
44         bool logToStdErr;
45         /**
46          * Immediate flush means that the underlying output stream
47          * will be flushed at the end of each append operation.
48          */
49         bool immediateFlush;
50     };
51 
52 } // end namespace log4cplus
53 
54 #endif // _LOG4CPLUS_CONSOLE_APPENDER_HEADER_


syntax highlighted by Code2HTML, v. 0.9.1