Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: chromeos/syslog_logging.h

Issue 6509006: libchromeos: add process control library, syslog logging capability, and run unit tests (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/common.git@master
Patch Set: respond to petkov, update interface Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_
OLDNEW
« chromeos/process.cc ('K') | « chromeos/process_test.cc ('k') | chromeos/syslog_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698