summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/api/log_private.idl
blob: 2194357ba1a73d3c6073ec2ef1e25548265785e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// Use chrome.logPrivate API to retrieve log information from multiple
// resources in a consistent format.
namespace logPrivate {

  // A filter class that filters log entries by different fields
  dictionary Filter {
    // Only logs from |sources| will be returned.
    DOMString[] sources;
    // Only logs created in [|start_timestamp|, |end_timestamp|] will
    // be returned.
    double start_timestamp;
    double end_timestamp;
    // Only logs have process name in |process| will be returned.
    DOMString[] process;
    //  Only logs have level in |level| will be returned.
    DOMString[] level;
  };

  // The class that contains log information.
  dictionary LogEntry {
    // The time of the log in milliseconds.
    double timestamp;
    // The raw text of log.
    DOMString full_entry;
    // The name of the process that the log associated with.
    DOMString process;
    // The ID of the process that the log associated with.
    DOMString process_id;
    // The log level.
    DOMString level;
  };

  // The class that is returned to callback function.
  dictionary Result {
    // The filter specified to filter log result.
    Filter filter;
    // Log entries returned based on the filter.
    LogEntry[] data;
  };

  callback GetHistoricalCallback = void (Result res);

  interface Functions {
    // Get the existing logs from ChromeOS system.
    static void getHistorical(Filter filter, GetHistoricalCallback callback);
  };

};