Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROMEOS_SYSLOG_LOGGING_H_ | |
| 6 #define CHROMEOS_SYSLOG_LOGGING_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 namespace chromeos { | |
| 11 | |
| 12 // Initialize logging subsystem. |log_to_stderr_too| causes logs to | |
| 13 // go to stderr as well as syslog. | |
| 14 void InitLog(bool log_to_syslog, bool log_to_stderr); | |
|
rginda
2011/02/28 18:15:20
How about a bitfield instead of the two booleans,
kmixter1
2011/03/02 01:38:07
Done.
| |
| 15 // Convenience function for configuring syslog via openlog. Users | |
| 16 // could call openlog directly except for naming collisions between | |
| 17 // base/logging.h and syslog.h. Similarly users cannot pass the | |
| 18 // normal parameters so we pick a representative set. |log_pid| | |
| 19 // causes pid to be logged with |ident|. | |
| 20 void OpenLog(const char* ident, bool log_pid); | |
| 21 // Start accumulating the logs to a string. This is inefficient, so | |
| 22 // do not set to true if large numbers of log messages are coming. | |
| 23 // Accumulated logs are only ever cleared when the clear function ings | |
| 24 // called. | |
| 25 void LogToString(bool enabled); | |
| 26 // Get the accumulated logs as a string. | |
| 27 std::string GetLog(); | |
| 28 // Clear the accumulated logs. | |
| 29 void ClearLog(); | |
| 30 // Returns true if the accumulated log contains the given string. Useful | |
| 31 // for testing. | |
| 32 bool FindLog(const char* string); | |
| 33 | |
| 34 } // namespace chromeos | |
| 35 | |
| 36 #endif // CHROMEOS_SYSLOG_LOGGING_H_ | |
| OLD | NEW |