chromium/net/log/net_log_capture_mode.h

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_LOG_NET_LOG_CAPTURE_MODE_H_
#define NET_LOG_NET_LOG_CAPTURE_MODE_H_

#include <stdint.h>

#include "net/base/net_export.h"

namespace net {

// NetLogCaptureMode specifies the logging level.
//
// It is used to control which events are emitted to the log, and what level of
// detail is included in their parameters.
//
// The capture mode is expressed as a number, where higher values imply more
// information.
//
// Note the numeric values are used in a bitfield (NetLogCaptureModeSet) so must
// be sequential starting from 0, and not exceed 31.
enum class NetLogCaptureMode : uint32_t {};

// Bitfield of NetLogCaptureMode, that should be initialized to zero for empty
// set. Bit "i" being set means that the set contains NetLogCaptureMode with
// value "i".
//
// Use the NetLogCaptureModeSet*() functions to operate on it.
NetLogCaptureModeSet;

inline NetLogCaptureModeSet NetLogCaptureModeToBit(
    NetLogCaptureMode capture_mode) {}

inline bool NetLogCaptureModeSetContains(NetLogCaptureMode capture_mode,
                                         NetLogCaptureModeSet set) {}

inline bool NetLogCaptureModeSetAdd(NetLogCaptureMode value,
                                    NetLogCaptureModeSet* set) {}

// Returns true if |capture_mode| permits logging sensitive values such as
// cookies and credentials.
NET_EXPORT bool NetLogCaptureIncludesSensitive(NetLogCaptureMode capture_mode);

// Returns true if |capture_mode| permits logging the full request/response
// bytes from sockets.
NET_EXPORT bool NetLogCaptureIncludesSocketBytes(
    NetLogCaptureMode capture_mode);

}  // namespace net

#endif  // NET_LOG_NET_LOG_CAPTURE_MODE_H_