log4cplus
2.0.6
include
log4cplus
helpers
loglog.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
// Module: Log4CPLUS
3
// File: loglog.h
4
// Created: 6/2001
5
// Author: Tad E. Smith
6
//
7
//
8
// Copyright 2001-2017 Tad E. Smith
9
//
10
// Licensed under the Apache License, Version 2.0 (the "License");
11
// you may not use this file except in compliance with the License.
12
// You may obtain a copy of the License at
13
//
14
// http://www.apache.org/licenses/LICENSE-2.0
15
//
16
// Unless required by applicable law or agreed to in writing, software
17
// distributed under the License is distributed on an "AS IS" BASIS,
18
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
// See the License for the specific language governing permissions and
20
// limitations under the License.
21
24
#ifndef LOG4CPLUS_HELPERS_LOGLOG
25
#define LOG4CPLUS_HELPERS_LOGLOG
26
27
#include <
log4cplus/config.hxx
>
28
29
#if defined (LOG4CPLUS_HAVE_PRAGMA_ONCE)
30
#pragma once
31
#endif
32
33
#include <
log4cplus/tstring.h
>
34
#include <
log4cplus/streams.h
>
35
#include <
log4cplus/thread/syncprims.h
>
36
37
38
namespace
log4cplus
{
39
namespace
helpers {
40
54
class
LOG4CPLUS_EXPORT
LogLog
55
{
56
public
:
58
typedef
LogLog
*
Ptr
;
59
63
static
Ptr
getLogLog
();
64
65
69
void
setInternalDebugging(
bool
enabled);
70
77
void
setQuietMode(
bool
quietMode);
78
83
void
debug(
const
log4cplus::tstring
& msg)
const
;
84
void
debug(
tchar
const
* msg)
const
;
85
93
void
error(
const
log4cplus::tstring
& msg,
bool
throw_flag =
false
)
const
;
94
void
error(
tchar
const
* msg,
bool
throw_flag =
false
)
const
;
95
101
void
warn(
const
log4cplus::tstring
& msg)
const
;
102
void
warn(
tchar
const
* msg)
const
;
103
104
// Public ctor and dtor to be used only by internal::DefaultContext.
105
LogLog
();
106
virtual
~
LogLog
();
107
108
private
:
109
enum
TriState
110
{
111
TriUndef = -1,
112
TriFalse,
113
TriTrue
114
};
115
116
template
<
typename
StringType>
117
LOG4CPLUS_PRIVATE
118
void
logging_worker (
tostream
& os,
119
bool
(
LogLog
:: * cond) ()
const
,
tchar
const
*,
120
StringType
const
&,
bool
throw_flag =
false
)
const
;
121
122
LOG4CPLUS_PRIVATE
static
void
set_tristate_from_env (TriState *,
123
tchar
const
* envvar);
124
125
LOG4CPLUS_PRIVATE
bool
get_quiet_mode ()
const
;
126
LOG4CPLUS_PRIVATE
bool
get_not_quiet_mode ()
const
;
127
LOG4CPLUS_PRIVATE
bool
get_debug_mode ()
const
;
128
129
// Data
130
mutable
TriState debugEnabled;
131
mutable
TriState quietMode;
132
thread::Mutex
mutex;
133
134
LOG4CPLUS_PRIVATE
LogLog
(
const
LogLog
&);
135
LOG4CPLUS_PRIVATE
LogLog
& operator = (
LogLog
const
&);
136
};
137
138
LOG4CPLUS_EXPORT
LogLog &
getLogLog
();
139
140
}
// end namespace helpers
141
}
// end namespace log4cplus
142
143
144
#endif // LOG4CPLUS_HELPERS_LOGLOG
145
tstring.h
log4cplus
Definition:
appender.h:46
log4cplus::tstring
std::basic_string< tchar > tstring
Definition:
tstring.h:39
streams.h
log4cplus::tchar
char tchar
Definition:
tchar.h:56
config.hxx
log4cplus::tostream
std::basic_ostream< tchar > tostream
Definition:
streams.h:40
LOG4CPLUS_EXPORT
#define LOG4CPLUS_EXPORT
Definition:
win32.h:141
log4cplus::helpers::getLogLog
LOG4CPLUS_EXPORT LogLog & getLogLog()
LOG4CPLUS_PRIVATE
#define LOG4CPLUS_PRIVATE
Definition:
config.hxx:53
log4cplus::thread::Mutex
Definition:
syncprims.h:63
log4cplus::helpers::LogLog
This class used to output log statements from within the log4cplus package.
Definition:
loglog.h:54
syncprims.h
log4cplus::helpers::LogLog::Ptr
LogLog * Ptr
Return type of getLogLog().
Definition:
loglog.h:58
Generated on Fri Jun 18 2021 08:46:20 for log4cplus by
1.8.17