summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn2014-02-26 11:50:16 -0600
committerMark Salyzyn2014-02-26 11:52:35 -0600
commit0175b0747a1f55329109e84c9a1322dcb95e2848 (patch)
treea48dd103279c3efc313028a09fb4570d212e624d /logd/FlushCommand.h
parent9b986497e7f19a7fde9e35eb73d765f4a09dee07 (diff)
downloadplatform-system-core-0175b0747a1f55329109e84c9a1322dcb95e2848.tar.gz
platform-system-core-0175b0747a1f55329109e84c9a1322dcb95e2848.tar.xz
platform-system-core-0175b0747a1f55329109e84c9a1322dcb95e2848.zip
logd: initial checkin.
* Create a new userspace log daemon for handling logging messages. Original-Change-Id: I75267df16359684490121e6c31cca48614d79856 Signed-off-by: Nick Kralevich <nnk@google.com> * Merge conflicts * rename new syslog daemon to logd to prevent confusion with bionic syslog * replace racy getGroups call with KISS call to client->getGid() * Timestamps are filed at logging source * insert entries into list in timestamp order * Added LogTimeEntry tail filtration handling * Added region locking around LogWriter list * separate threads for each writer * /dev/socket/logd* permissions Signed-off-by: Mark Salyzyn <salyzyn@google.com> (cherry picked from commit 3e76e0a49760c4970b7cda6153e51026af98e4f3) Author: Nick Kralevich <nnk@google.com> Change-Id: Ice88b1412d8f9daa7f9119b2b5aaf684a5e28098
Diffstat (limited to 'logd/FlushCommand.h')
-rw-r--r--logd/FlushCommand.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/logd/FlushCommand.h b/logd/FlushCommand.h
new file mode 100644
index 000000000..715daacc0
--- /dev/null
+++ b/logd/FlushCommand.h
@@ -0,0 +1,41 @@
1/*
2 * Copyright (C) 2012-2013 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef _FLUSH_COMMAND_H
17#define _FLUSH_COMMAND_H
18
19#include <sysutils/SocketClientCommand.h>
20
21class LogReader;
22
23class FlushCommand : public SocketClientCommand {
24 LogReader &mReader;
25 bool mNonBlock;
26 unsigned long mTail;
27 unsigned int mLogMask;
28 pid_t mPid;
29
30public:
31 FlushCommand(LogReader &mReader,
32 bool nonBlock = false,
33 unsigned long tail = -1,
34 unsigned int logMask = -1,
35 pid_t pid = 0);
36 virtual void runSocketCommand(SocketClient *client);
37
38 static bool hasReadLogs(SocketClient *client);
39};
40
41#endif