OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_LOGGING_H_ | 5 #ifndef BASE_LOGGING_H_ |
6 #define BASE_LOGGING_H_ | 6 #define BASE_LOGGING_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <cstring> | 9 #include <cstring> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 // Sets the log level. Anything at or above this level will be written to the | 147 // Sets the log level. Anything at or above this level will be written to the |
148 // log file/displayed to the user (if applicable). Anything below this level | 148 // log file/displayed to the user (if applicable). Anything below this level |
149 // will be silently ignored. The log level defaults to 0 (everything is logged) | 149 // will be silently ignored. The log level defaults to 0 (everything is logged) |
150 // if this function is not called. | 150 // if this function is not called. |
151 void SetMinLogLevel(int level); | 151 void SetMinLogLevel(int level); |
152 | 152 |
153 // Gets the current log level. | 153 // Gets the current log level. |
154 int GetMinLogLevel(); | 154 int GetMinLogLevel(); |
155 | 155 |
156 #if defined(OS_LINUX) | 156 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
157 // Get the file descriptor used for logging. | 157 // Get the file descriptor used for logging. |
158 // Returns -1 if none open. | 158 // Returns -1 if none open. |
159 // Needed by ZygoteManager. | 159 // Needed by ZygoteManager. |
160 int GetLoggingFileDescriptor(); | 160 int GetLoggingFileDescriptor(); |
161 #endif | 161 #endif |
162 | 162 |
163 // Sets the log filter prefix. Any log message below LOG_ERROR severity that | 163 // Sets the log filter prefix. Any log message below LOG_ERROR severity that |
164 // doesn't start with this prefix with be silently ignored. The filter defaults | 164 // doesn't start with this prefix with be silently ignored. The filter defaults |
165 // to NULL (everything is logged) if this function is not called. Messages | 165 // to NULL (everything is logged) if this function is not called. Messages |
166 // with severity of LOG_ERROR or higher will not be filtered. | 166 // with severity of LOG_ERROR or higher will not be filtered. |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 #elif NOTIMPLEMENTED_POLICY == 4 | 832 #elif NOTIMPLEMENTED_POLICY == 4 |
833 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG | 833 #define NOTIMPLEMENTED() LOG(ERROR) << NOTIMPLEMENTED_MSG |
834 #elif NOTIMPLEMENTED_POLICY == 5 | 834 #elif NOTIMPLEMENTED_POLICY == 5 |
835 #define NOTIMPLEMENTED() do {\ | 835 #define NOTIMPLEMENTED() do {\ |
836 static int count = 0;\ | 836 static int count = 0;\ |
837 LOG_IF(ERROR, 0 == count++) << NOTIMPLEMENTED_MSG;\ | 837 LOG_IF(ERROR, 0 == count++) << NOTIMPLEMENTED_MSG;\ |
838 } while(0) | 838 } while(0) |
839 #endif | 839 #endif |
840 | 840 |
841 #endif // BASE_LOGGING_H_ | 841 #endif // BASE_LOGGING_H_ |
OLD | NEW |