activemq-cpp-3.8.2
LoggerDefines.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 #ifndef _DECAF_UTIL_LOGGING_LOGGERDEFINES_H_
18 #define _DECAF_UTIL_LOGGING_LOGGERDEFINES_H_
19 
21 #include <sstream>
22 
23 #define LOGDECAF_DECLARE(loggerName) \
24  static decaf::util::logging::SimpleLogger loggerName;
25 
26 #define LOGDECAF_INITIALIZE(loggerName, className, loggerFamily) \
27  decaf::util::logging::SimpleLogger className::loggerName(loggerFamily);
28 
29 #define LOGDECAF_DECLARE_LOCAL(loggerName) \
30  decaf::util::logging::Logger loggerName;
31 
32 #define LOGDECAF_DEBUG(logger, message) \
33  logger.debug(__FILE__, __LINE__, message);
34 
35 #define LOGDECAF_DEBUG_1(logger, message, value); \
36  { \
37  std::ostringstream ostream; \
38  ostream << message << value; \
39  logger.debug(__FILE__, __LINE__, ostream.str()); \
40  }
41 
42 #define LOGDECAF_INFO(logger, message) \
43  logger.info(__FILE__, __LINE__, message);
44 
45 #define LOGDECAF_ERROR(logger, message) \
46  logger.error(__FILE__, __LINE__, message);
47 
48 #define LOGDECAF_WARN(logger, message) \
49  logger.warn(__FILE__, __LINE__, message);
50 
51 #define LOGDECAF_FATAL(logger, message) \
52  logger.fatal(__FILE__, __LINE__, message);
53 
54 
55 #endif