• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4
5// Use chrome.logPrivate API to retrieve log information from multiple
6// resources in a consistent format.
7namespace logPrivate {
8
9  // A filter class that filters log entries by different fields
10  dictionary Filter {
11    // Only logs from |sources| will be returned.
12    DOMString[] sources;
13    // Only logs created in [|start_timestamp|, |end_timestamp|] will
14    // be returned.
15    double start_timestamp;
16    double end_timestamp;
17    // Only logs have process name in |process| will be returned.
18    DOMString[] process;
19    //  Only logs have level in |level| will be returned.
20    DOMString[] level;
21    // Private information will be scrubbed if |scrub| is true.
22    boolean scrub;
23  };
24
25  // The class that contains log information.
26  dictionary LogEntry {
27    // The time of the log in milliseconds.
28    double timestamp;
29    // The raw text of log.
30    DOMString full_entry;
31    // The name of the process that the log associated with.
32    DOMString process;
33    // The ID of the process that the log associated with.
34    DOMString process_id;
35    // The log level.
36    DOMString level;
37  };
38
39  // The class that is returned to callback function.
40  dictionary Result {
41    // The filter specified to filter log result.
42    Filter filter;
43    // Log entries returned based on the filter.
44    LogEntry[] data;
45  };
46
47  callback GetHistoricalCallback = void (Result res);
48
49  interface Functions {
50    // Get the existing logs from ChromeOS system.
51    static void getHistorical(Filter filter, GetHistoricalCallback callback);
52    static void startNetInternalsWatch();
53    static void stopNetInternalsWatch();
54  };
55
56  interface Events {
57    static void onAddNetInternalsEntries(object[] entries);
58  };
59};
60