blob: 67e408d648a73958bb2ea682ef871e3e339598ed [file] [log] [blame]
Elad Alon83ccca12017-10-04 13:18:26 +02001/*
2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Elad Alon80810732017-10-06 13:07:32 +020011#ifndef API_RTCEVENTLOGOUTPUT_H_
12#define API_RTCEVENTLOGOUTPUT_H_
Elad Alon83ccca12017-10-04 13:18:26 +020013
14#include <string>
15
16namespace webrtc {
17
Elad Alon80810732017-10-06 13:07:32 +020018// NOTE: This class is still under development and may change without notice.
Elad Alon83ccca12017-10-04 13:18:26 +020019class RtcEventLogOutput {
20 public:
21 virtual ~RtcEventLogOutput() = default;
22
23 // An output normally starts out active, though that might not always be
24 // the case (e.g. failed to open a file for writing).
25 // Once an output has become inactive (e.g. maximum file size reached), it can
26 // never become active again.
27 virtual bool IsActive() const = 0;
28
29 // Write encoded events to an output. Returns true if the output was
30 // successfully written in its entirety. Otherwise, no guarantee is given
31 // about how much data was written, if any. The output sink becomes inactive
32 // after the first time |false| is returned. Write() may not be called on
33 // an inactive output sink.
34 virtual bool Write(const std::string& output) = 0;
35};
36
37} // namespace webrtc
38
Elad Alon80810732017-10-06 13:07:32 +020039#endif // API_RTCEVENTLOGOUTPUT_H_