blob: 8d7d2cdeb3bd4db11a15b7f048379e878af7fade [file] [log] [blame]
Elly Jones03cd6d72012-06-11 13:04:28 -04001// Copyright (c) 2012 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
Alex Vakulenko262be3f2014-07-30 15:25:50 -07005#ifndef DEBUGD_SRC_LOG_TOOL_H_
6#define DEBUGD_SRC_LOG_TOOL_H_
Elly Jones03cd6d72012-06-11 13:04:28 -04007
Gaurav Shahf6c8f2a2012-10-11 17:22:43 -07008#include <map>
Ben Chan5facf4a2014-07-23 16:36:54 -07009#include <string>
Elly Jones03cd6d72012-06-11 13:04:28 -040010
11#include <base/basictypes.h>
12#include <dbus-c++/dbus.h>
13
14namespace debugd {
15
16class LogTool {
17 public:
Ben Chan78f89532014-08-29 09:35:09 -070018 LogTool() = default;
19 ~LogTool() = default;
Elly Jones03cd6d72012-06-11 13:04:28 -040020
Elly Jones533c7c42012-08-10 15:07:05 -040021 typedef std::map<std::string, std::string> LogMap;
22
Ben Chana0011d82014-05-13 00:19:29 -070023 std::string GetLog(const std::string& name, DBus::Error* error);
24 LogMap GetAllLogs(DBus::Error* error);
25 LogMap GetFeedbackLogs(DBus::Error* error);
26 LogMap GetUserLogFiles(DBus::Error* error);
Darin Petkovce9b3a12013-01-10 16:38:54 +010027
Elly Jones03cd6d72012-06-11 13:04:28 -040028 private:
Darin Petkovce9b3a12013-01-10 16:38:54 +010029 friend class LogToolTest;
30
31 void AnonymizeLogMap(LogMap* log_map);
32
Elly Jones03cd6d72012-06-11 13:04:28 -040033 DISALLOW_COPY_AND_ASSIGN(LogTool);
34};
35
Ben Chana0011d82014-05-13 00:19:29 -070036} // namespace debugd
Elly Jones03cd6d72012-06-11 13:04:28 -040037
Alex Vakulenko262be3f2014-07-30 15:25:50 -070038#endif // DEBUGD_SRC_LOG_TOOL_H_