1 // Copyright 2013 The Chromium 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.
5 // Use chrome.logPrivate API to retrieve log information from multiple
6 // resources in a consistent format.
9 // A filter class that filters log entries by different fields
11 // Only logs from |sources| will be returned.
13 // Only logs created in [|start_timestamp|, |end_timestamp|] will
15 double start_timestamp
;
17 // Only logs have process name in |process| will be returned.
19 // Only logs have level in |level| will be returned.
21 // Private information will be scrubbed if |scrub| is true.
25 // The class that contains log information.
27 // The time of the log in milliseconds.
29 // The raw text of log.
31 // The name of the process that the log associated with.
33 // The ID of the process that the log associated with.
39 // The class that is returned to callback function.
41 // The filter specified to filter log result.
43 // Log entries returned based on the filter.
47 callback GetHistoricalCallback
= void (Result res
);
49 callback DumpLogsCallback
= void ([instanceOf
=FileEntry
] object logs
);
51 callback CompletionCallback
= void ();
53 // The type of the events to be recorded.
54 enum EventType
{ network
};
56 // The type of the event sink where captured events will be sent.
58 // Events will be sent to the webapp via onCapturedEvents.
60 // Events will be sent to a log file which can be collected
61 // through archive generated with dumpLogs() call.
66 // Get the existing logs from ChromeOS system.
67 static
void getHistorical
(Filter filter
, GetHistoricalCallback
callback);
68 // Start capturing events of specific type.
69 static
void startEventRecorder
(EventType eventType
,
71 CompletionCallback
callback);
72 // Stop capturing events of specific type.
73 static
void stopEventRecorder
(EventType eventType
, CompletionCallback
callback);
74 // Dump all system and captured events into a .tar.gz file.
75 // The archive file will contain following top level directories:
77 // ChromeOS system logs.
78 // /home/chronos/user/log/
79 // Session specific logs (chrome app logs).
80 // /home/chronos/user/log/apps/<app_id>
81 // Contains webapp specific logs including those collected with
82 // startEventRecorder(..., sink="file") call.
83 static
void dumpLogs
(DumpLogsCallback
callback);
87 // Receives events of type which is currently being captured.
88 static
void onCapturedEvents
(object[] entries
);