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

Side by Side Diff: chromeos/syslog_logging.h

Issue 6597120: libchromeos: re-push 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: Created 9 years, 9 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
« no previous file with comments | « chromeos/process_test.cc ('k') | chromeos/syslog_logging.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 enum InitFlags {
13 kLogToSyslog = 1,
14 kLogToStderr = 2
15 };
16
17 // Initialize logging subsystem. |flags| indicates
18 void InitLog(int init_flags);
19 // Convenience function for configuring syslog via openlog. Users
20 // could call openlog directly except for naming collisions between
21 // base/logging.h and syslog.h. Similarly users cannot pass the
22 // normal parameters so we pick a representative set. |log_pid|
23 // causes pid to be logged with |ident|.
24 void OpenLog(const char* ident, bool log_pid);
25 // Start accumulating the logs to a string. This is inefficient, so
26 // do not set to true if large numbers of log messages are coming.
27 // Accumulated logs are only ever cleared when the clear function ings
28 // called.
29 void LogToString(bool enabled);
30 // Get the accumulated logs as a string.
31 std::string GetLog();
32 // Clear the accumulated logs.
33 void ClearLog();
34 // Returns true if the accumulated log contains the given string. Useful
35 // for testing.
36 bool FindLog(const char* string);
37
38 } // namespace chromeos
39
40 #endif // CHROMEOS_SYSLOG_LOGGING_H_
OLDNEW
« no previous file with comments | « chromeos/process_test.cc ('k') | chromeos/syslog_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698