// 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;
    // Private information will be scrubbed if |scrub| is true.
    boolean scrub;
  };

  // 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);
  };

};