reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
Logger.hxx
Go to the documentation of this file.
1#ifndef RESIP_Logger_hxx
2#define RESIP_Logger_hxx
3
4#include "rutil/Log.hxx"
5#include "rutil/Lock.hxx"
7#include "rutil/Data.hxx"
8#include "rutil/Subsystem.hxx"
9
10#ifdef WIN32
11#include <windows.h>
12#endif
13
115#define DELIM
116
117
118
119// unconditionally output to cerr -- easily change back and forth
120#define CerrLog(args_) \
121 resip::Log::tags(resip::Log::StdErr, RESIPROCATE_SUBSYSTEM, \
122 __FILE__, __LINE__, __func__, resipCerr, resip::Log::Unstructured) << ' ' << '|' << ' ' \
123 args_ << std::endl;
124
125#define StackLog(args_) \
126GenericLog(RESIPROCATE_SUBSYSTEM, resip::Log::Stack, args_)
127
128#define DebugLog(args_) \
129GenericLog(RESIPROCATE_SUBSYSTEM, resip::Log::Debug, args_)
130
131#define InfoLog(args_) \
132GenericLog(RESIPROCATE_SUBSYSTEM, resip::Log::Info, args_)
133
134#define WarningLog(args_) \
135GenericLog(RESIPROCATE_SUBSYSTEM, resip::Log::Warning, args_)
136
137#define ErrLog(args_) \
138GenericLog(RESIPROCATE_SUBSYSTEM, resip::Log::Err, args_)
139
140#define CritLog(args_) \
141GenericLog(RESIPROCATE_SUBSYSTEM, resip::Log::Crit, args_)
142
143static inline bool
148
149// do/while allows a {} block in an expression
150#define GenericLog(system_, level_, args_) \
151 do \
152 { \
153 if (genericLogCheckLevel(level_, system_)) \
154 { \
155 resip::Log::Guard _resip_log_guard(level_, system_, __FILE__, __LINE__, __func__); \
156 _resip_log_guard.asStream() args_; \
157 } \
158 } while (false)
159
160#ifdef NO_DEBUG
161// Suppress debug logging at compile time
162#undef DebugLog
163#define DebugLog(args_)
164#undef StackLog
165#define StackLog(args_)
166#endif
167
168namespace resip
169{
172}
173
174#endif
175
176/* ====================================================================
177 * The Vovida Software License, Version 1.0
178 *
179 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
180 *
181 * Redistribution and use in source and binary forms, with or without
182 * modification, are permitted provided that the following conditions
183 * are met:
184 *
185 * 1. Redistributions of source code must retain the above copyright
186 * notice, this list of conditions and the following disclaimer.
187 *
188 * 2. Redistributions in binary form must reproduce the above copyright
189 * notice, this list of conditions and the following disclaimer in
190 * the documentation and/or other materials provided with the
191 * distribution.
192 *
193 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
194 * and "Vovida Open Communication Application Library (VOCAL)" must
195 * not be used to endorse or promote products derived from this
196 * software without prior written permission. For written
197 * permission, please contact vocal@vovida.org.
198 *
199 * 4. Products derived from this software may not be called "VOCAL", nor
200 * may "VOCAL" appear in their name, without prior written
201 * permission of Vovida Networks, Inc.
202 *
203 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
204 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
205 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
206 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
207 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
208 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
209 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
210 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
211 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
212 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
213 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
214 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
215 * DAMAGE.
216 *
217 * ====================================================================
218 *
219 * This software consists of voluntary contributions made by Vovida
220 * Networks, Inc. and many individuals on behalf of Vovida Networks,
221 * Inc. For more information on Vovida Networks, Inc., please see
222 * <http://www.vovida.org/>.
223 *
224 */
static bool genericLogCheckLevel(resip::Log::Level level, const resip::Subsystem &sub)
Definition Logger.hxx:144
Singleton that handles logging calls.
Definition Log.hxx:51
static bool isLogging(Log::Level level, const Subsystem &)
Definition Log.cxx:971
Class used to specify what sub-system given sections of code belong to, for use by the logging system...
Definition Subsystem.hxx:34
dcm! – add UnusedChecking(_enum) below;
Log GenericLogImpl
DEPRECATED! Left for backward compatibility.
Definition Logger.hxx:171
void list()
Definition userAdmin.cxx:66