Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
logging.h
Go to the documentation of this file.
1 // Copyright 2012 Cloudera Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 
16 #ifndef IMPALA_COMMON_LOGGING_H
17 #define IMPALA_COMMON_LOGGING_H
18 
22 #ifdef IR_COMPILE
23 #include <iostream>
24  #define DCHECK(condition) while(false) std::cout
25  #define DCHECK_EQ(a, b) while(false) std::cout
26  #define DCHECK_NE(a, b) while(false) std::cout
27  #define DCHECK_GT(a, b) while(false) std::cout
28  #define DCHECK_LT(a, b) while(false) std::cout
29  #define DCHECK_GE(a, b) while(false) std::cout
30  #define DCHECK_LE(a, b) while(false) std::cout
31  #define DCHECK_NOTNULL(a) while(false) std::cout
32  #define LOG(level) while(false) std::cout
34  #define VLOG(level) while(false) std::cout
35  #define VLOG_IS_ON(level) (false)
36 #else
37  #undef _XOPEN_SOURCE
42  #include <glog/logging.h>
43  #include <gflags/gflags.h>
44 
45  #ifdef NDEBUG
46  #undef DCHECK_NOTNULL
47  #define DCHECK_NOTNULL(a) while(false)
50  #endif
51 #endif
52 
55 #define VLOG_CONNECTION VLOG(1)
56 #define VLOG_RPC VLOG(2)
57 #define VLOG_QUERY VLOG(1)
58 #define VLOG_FILE VLOG(2)
59 #define VLOG_ROW VLOG(3)
60 #define VLOG_PROGRESS VLOG(2)
61 
62 #define VLOG_CONNECTION_IS_ON VLOG_IS_ON(1)
63 #define VLOG_RPC_IS_ON VLOG_IS_ON(2)
64 #define VLOG_QUERY_IS_ON VLOG_IS_ON(1)
65 #define VLOG_FILE_IS_ON VLOG_IS_ON(2)
66 #define VLOG_ROW_IS_ON VLOG_IS_ON(3)
67 #define VLOG_PROGRESS_IS_ON VLOG_IS_ON(2)
68 
71 #ifndef IR_COMPILE
72 namespace impala {
73 
76 void InitGoogleLoggingSafe(const char* arg);
77 
80 void GetFullLogFilename(google::LogSeverity severity, std::string* filename);
81 
84 void ShutdownLogging();
85 
87 void LogCommandLineFlags();
88 
91 void CheckAndRotateLogFiles(int max_log_files);
92 }
93 
94 #endif // IR_COMPILE
95 
96 #endif
void ShutdownLogging()
Definition: logging.cc:146
void GetFullLogFilename(google::LogSeverity severity, std::string *filename)
void InitGoogleLoggingSafe(const char *arg)
Definition: logging.cc:55
void CheckAndRotateLogFiles(int max_log_files)
Definition: logging.cc:159
void LogCommandLineFlags()
Writes all command-line flags to the log at level INFO.
Definition: logging.cc:154