Apache log4cxx Version 0.13.0
Loading...
Searching...
No Matches
ttcclayout.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef _LOG4CXX_TTCC_LAYOUT_H
19#define _LOG4CXX_TTCC_LAYOUT_H
20
21#if defined(_MSC_VER)
22 #pragma warning ( push )
23 #pragma warning ( disable: 4231 4251 4275 4786 )
24#endif
25
27
28namespace log4cxx
29{
30
73class LOG4CXX_EXPORT TTCCLayout : public helpers::DateLayout
74{
75 private:
76 // Internal representation of options
77 bool threadPrinting;
78 bool categoryPrefixing;
79 bool contextPrinting;
80 bool filePrinting;
81
82 public:
88
89
95
102 TTCCLayout(const LogString& dateFormatType);
103
108 inline void setThreadPrinting(bool threadPrinting1)
109 {
110 this->threadPrinting = threadPrinting1;
111 }
112
116 inline bool getThreadPrinting() const
117 {
118 return threadPrinting;
119 }
120
125 inline void setCategoryPrefixing(bool categoryPrefixing1)
126 {
127 this->categoryPrefixing = categoryPrefixing1;
128 }
129
133 inline bool getCategoryPrefixing() const
134 {
135 return categoryPrefixing;
136 }
137
143 inline void setContextPrinting(bool contextPrinting1)
144 {
145 this->contextPrinting = contextPrinting1;
146 }
147
151 inline bool getContextPrinting() const
152 {
153 return contextPrinting;
154 }
155
160 inline void setFilePrinting(bool filePrinting1)
161 {
162 this->filePrinting = filePrinting1;
163 }
164
168 inline bool getFilePrinting() const
169 {
170 return filePrinting;
171 }
172
185 virtual void format(LogString& output,
186 const spi::LoggingEventPtr& event, log4cxx::helpers::Pool& pool) const;
187
193 virtual bool ignoresThrowable() const
194 {
195 return true;
196 }
197};
199}
200
201
202#if defined(_MSC_VER)
203 #pragma warning ( pop )
204#endif
205
206#endif
Extend this abstract class to create your own log layout format.
Definition: layout.h:40
TTCC layout format consists of time, thread, logger name and nested diagnostic context information,...
Definition: ttcclayout.h:74
bool getCategoryPrefixing() const
Returns value of the CategoryPrefixing option.
Definition: ttcclayout.h:133
void setCategoryPrefixing(bool categoryPrefixing1)
The CategoryPrefixing option specifies whether Logger name is part of log output or not.
Definition: ttcclayout.h:125
void setContextPrinting(bool contextPrinting1)
The ContextPrinting option specifies log output will include the nested context information belonging...
Definition: ttcclayout.h:143
bool getThreadPrinting() const
Returns value of the ThreadPrinting option.
Definition: ttcclayout.h:116
void setFilePrinting(bool filePrinting1)
The FilePrinting option specifies log output will include the file and the line where the log stateme...
Definition: ttcclayout.h:160
virtual void format(LogString &output, const spi::LoggingEventPtr &event, log4cxx::helpers::Pool &pool) const
In addition to the level of the statement and message, this function writes to the ouput stream time,...
bool getContextPrinting() const
Returns value of the ContextPrinting option.
Definition: ttcclayout.h:151
virtual bool ignoresThrowable() const
The TTCCLayout does not handle the throwable contained within LoggingEvents.
Definition: ttcclayout.h:193
bool getFilePrinting() const
Returns value of the ContextPrinting option.
Definition: ttcclayout.h:168
This abstract layout takes care of all the date related options and formatting work.
Definition: datelayout.h:39
Definition: pool.h:33
std::shared_ptr< LoggingEvent > LoggingEventPtr
Definition: appender.h:38
Definition: messagehandler.h:23
std::basic_string< logchar > LogString
Definition: logstring.h:66
LOG4CXX_PTR_DEF(Appender)
#define LOG4CXX_CAST_ENTRY(Interface)
Definition: object.h:153
#define END_LOG4CXX_CAST_MAP()
Definition: object.h:147
#define DECLARE_LOG4CXX_OBJECT(object)
Definition: object.h:39
#define LOG4CXX_CAST_ENTRY_CHAIN(Interface)
Definition: object.h:159
#define BEGIN_LOG4CXX_CAST_MAP()
Definition: object.h:141