log4cplus  2.1.0
qt5debugappender.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Module: Log4cplus
3 // File: qt5debugappender.h
4 // Created: 4/2013
5 // Author: Vaclav Zeman
6 //
7 //
8 // Copyright (C) 2013-2017, Vaclav Zeman. All rights reserved.
9 //
10 // Redistribution and use in source and binary forms, with or without modifica-
11 // tion, are permitted provided that the following conditions are met:
12 //
13 // 1. Redistributions of source code must retain the above copyright notice,
14 // this list of conditions and the following disclaimer.
15 //
16 // 2. Redistributions in binary form must reproduce the above copyright notice,
17 // this list of conditions and the following disclaimer in the documentation
18 // and/or other materials provided with the distribution.
19 //
20 // THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
21 // INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
22 // FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23 // APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
25 // DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
26 // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
27 // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 
32 //
33 
36 #ifndef LOG4CPLUS_QT5DEBUGAPPENDER_H
37 #define LOG4CPLUS_QT5DEBUGAPPENDER_H
38 
39 #include <log4cplus/config.hxx>
40 
41 #if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
42 #pragma once
43 #endif
44 
45 #include <log4cplus/appender.h>
46 
47 #if defined (_WIN32)
48  #if defined (log4cplusqt5debugappender_EXPORTS) \
49  || defined (log4cplusqt5debugappenderU_EXPORTS) \
50  || (defined (DLL_EXPORT) && defined (INSIDE_LOG4CPLUS_QT5DEBUGAPPENDER))
51  #undef LOG4CPLUS_QT5DEBUGAPPENDER_BUILD_DLL
52  #define LOG4CPLUS_QT5DEBUGAPPENDER_BUILD_DLL
53  #endif
54  #if defined (LOG4CPLUS_QT5DEBUGAPPENDER_BUILD_DLL)
55  #if defined (INSIDE_LOG4CPLUS_QT5DEBUGAPPENDER)
56  #define LOG4CPLUS_QT5DEBUGAPPENDER_EXPORT __declspec(dllexport)
57  #else
58  #define LOG4CPLUS_QT5DEBUGAPPENDER_EXPORT __declspec(dllimport)
59  #endif
60  #else
61  #define LOG4CPLUS_QT5DEBUGAPPENDER_EXPORT
62  #endif
63 #else
64  #if defined (INSIDE_LOG4CPLUS_QT5DEBUGAPPENDER)
65  #define LOG4CPLUS_QT5DEBUGAPPENDER_EXPORT LOG4CPLUS_DECLSPEC_EXPORT
66  #else
67  #define LOG4CPLUS_QT5DEBUGAPPENDER_EXPORT LOG4CPLUS_DECLSPEC_IMPORT
68  #endif // defined (INSIDE_LOG4CPLUS_QT5DEBUGAPPENDER)
69 #endif // !_WIN32
70 
71 
72 namespace log4cplus
73 {
74 
75 
77  : public Appender
78 {
79 public:
82  virtual ~Qt5DebugAppender ();
83 
84  virtual void close ();
85 
86  static void registerAppender ();
87 
88 protected:
89  virtual void append (spi::InternalLoggingEvent const &);
90 
91 private:
93  Qt5DebugAppender & operator = (Qt5DebugAppender const &);
94 };
95 
96 
98 
99 
100 } // namespace log4cplus
101 
102 
103 #endif // LOG4CPLUS_QT5DEBUGAPPENDER_H
Extend this class for implementing your own strategies for printing log statements.
Definition: appender.h:139
Qt5DebugAppender(helpers::Properties const &)
virtual void append(spi::InternalLoggingEvent const &)
Subclasses of Appender should implement this method to perform actual logging.
static void registerAppender()
virtual void close()
Release any resources allocated within the appender such as file handles, network connections,...
The internal representation of logging events.
Definition: loggingevent.h:51
helpers::SharedObjectPtr< Qt5DebugAppender > Qt5DebugAppenderPtr
#define LOG4CPLUS_QT5DEBUGAPPENDER_EXPORT