blob: 43a9ed34f36a6ff4fbb0cbc7efc9ba0e6b0baea8 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Code generated by third_party/go/regen-fidl; DO NOT EDIT.
package logger
import (
_zx "syscall/zx"
fuchsiadiagnostics "syscall/zx/diagnostics"
_bindings "syscall/zx/fidl"
)
const (
// The interval between discrete log severity levels
LogSeverityStepSize uint8 = 16
// Maximum available log severity.
LogSeverityMaxStep uint8 = 6
// The interval between discrete log verbosity levels
LogVerbosityStepSize uint8 = 1
// Default log level used to initialize loggers.
LogLevelDefault uint8 = 48
// Max number of tags that can be passed to filter by listener.
MaxTags uint8 = 16
// Max tag length that can be passed to filter by listener.
MaxTagLenBytes uint8 = 63
// A placeholder tag which indicates to a `LogSink` that the tag should be replaced with
// the actual name of the logging component. If that name is unavailable, `LogSink`
// implementations should replace this value with `UNKNOWN`.
ComponentNamePlaceholderTag string = "COMPONENT_NAME"
// Max number of LogInterestSelectors that can be specified via a listener.
MaxLogSelectors uint8 = 5
// Max tags that will be attached to a LogMessage.
MaxTagsPerLogMessage uint8 = 5
// Max byte size for message payload.
MaxDatagramLenBytes uint32 = 32768
// Max log bytes per call to a listener.
MaxLogManySizeBytes uint64 = 16384
)
var _ _bindings.Enum = LogLevelFilter(0)
// Log levels used with log related filtering.
// Filtering uses a heuristic based on a threshold of
// minimum severity level - with any log equal to or
// greater than the threshold being included in the
// printable logs.
type LogLevelFilter int8
const (
LogLevelFilterDeprecatedNone LogLevelFilter = -1
LogLevelFilterDeprecatedInfo LogLevelFilter = 0
LogLevelFilterDeprecatedWarn LogLevelFilter = 1
LogLevelFilterDeprecatedError LogLevelFilter = 2
LogLevelFilterDeprecatedFatal LogLevelFilter = 3
LogLevelFilterAll LogLevelFilter = -127
LogLevelFilterTrace LogLevelFilter = 16
LogLevelFilterDebug LogLevelFilter = 32
LogLevelFilterInfo LogLevelFilter = 48
LogLevelFilterWarn LogLevelFilter = 64
LogLevelFilterError LogLevelFilter = 80
LogLevelFilterFatal LogLevelFilter = 96
LogLevelFilterNone LogLevelFilter = 127
)
func (_ LogLevelFilter) I_EnumValues() []LogLevelFilter {
return []LogLevelFilter{
LogLevelFilterDeprecatedNone,
LogLevelFilterDeprecatedInfo,
LogLevelFilterDeprecatedWarn,
LogLevelFilterDeprecatedError,
LogLevelFilterDeprecatedFatal,
LogLevelFilterAll,
LogLevelFilterTrace,
LogLevelFilterDebug,
LogLevelFilterInfo,
LogLevelFilterWarn,
LogLevelFilterError,
LogLevelFilterFatal,
LogLevelFilterNone,
}
}
func (_ LogLevelFilter) I_EnumIsStrict() bool {
return true
}
func (x LogLevelFilter) IsUnknown() bool {
switch x {
case -1:
return false
case 0:
return false
case 1:
return false
case 2:
return false
case 3:
return false
case -127:
return false
case 16:
return false
case 32:
return false
case 48:
return false
case 64:
return false
case 80:
return false
case 96:
return false
case 127:
return false
default:
return true
}
}
func (x LogLevelFilter) String() string {
switch x {
case -1:
return "DeprecatedNone"
case 0:
return "DeprecatedInfo"
case 1:
return "DeprecatedWarn"
case 2:
return "DeprecatedError"
case 3:
return "DeprecatedFatal"
case -127:
return "All"
case 16:
return "Trace"
case 32:
return "Debug"
case 48:
return "Info"
case 64:
return "Warn"
case 80:
return "Error"
case 96:
return "Fatal"
case 127:
return "None"
}
return "Unknown"
}
type LogFilterOptions struct {
_ struct{} `fidl:"s" fidl_size_v1:"56" fidl_alignment_v1:"8" fidl_size_v2:"56" fidl_alignment_v2:"8"`
FilterByPid bool `fidl_offset_v1:"0" fidl_offset_v2:"0"`
Pid uint64 `fidl_offset_v1:"8" fidl_offset_v2:"8"`
FilterByTid bool `fidl_offset_v1:"16" fidl_offset_v2:"16"`
Tid uint64 `fidl_offset_v1:"24" fidl_offset_v2:"24"`
// If more than zero, logs would be filtered based on verbosity and
// `min_severity` would be ignored.
Verbosity uint8 `fidl_offset_v1:"32" fidl_offset_v2:"32"`
// Severity used as threshold to determine logging level.
MinSeverity LogLevelFilter `fidl_offset_v1:"33" fidl_offset_v2:"33"`
// If non-empty, return all messages which contain at least one specified
// tag. If empty, messages will not be filtered by tag.
// Passed tags should not be more than `MAX_TAG_LEN_BYTES` bytes in length
// and max tags can be `MAX_TAGS`.
// Listener would be discarded if the limit is not followed.
Tags []string `fidl_offset_v1:"40" fidl_offset_v2:"40" fidl_bounds:"16,63"`
}
var _mLogFilterOptions = _bindings.CreateLazyMarshaler(LogFilterOptions{})
func (msg *LogFilterOptions) Marshaler() _bindings.Marshaler {
return _mLogFilterOptions
}
// Conveyance to couple a specified Interest with its designated target,
// specified via a ComponentSelector.
type LogInterestSelector struct {
_ struct{} `fidl:"s" fidl_size_v1:"32" fidl_alignment_v1:"8" fidl_size_v2:"32" fidl_alignment_v2:"8"`
Selector fuchsiadiagnostics.ComponentSelector `fidl_offset_v1:"0" fidl_offset_v2:"0"`
Interest fuchsiadiagnostics.Interest `fidl_offset_v1:"16" fidl_offset_v2:"16"`
}
var _mLogInterestSelector = _bindings.CreateLazyMarshaler(LogInterestSelector{})
func (msg *LogInterestSelector) Marshaler() _bindings.Marshaler {
return _mLogInterestSelector
}
type LogMessage struct {
_ struct{} `fidl:"s" fidl_size_v1:"64" fidl_alignment_v1:"8" fidl_size_v2:"64" fidl_alignment_v2:"8"`
Pid uint64 `fidl_offset_v1:"0" fidl_offset_v2:"0"`
Tid uint64 `fidl_offset_v1:"8" fidl_offset_v2:"8"`
// https://fuchsia.dev/fuchsia-src/reference/syscalls/clock_get_monotonic.md
Time int64 `fidl_offset_v1:"16" fidl_offset_v2:"16"`
Severity int32 `fidl_offset_v1:"24" fidl_offset_v2:"24"`
// See //zircon/system/ulib/syslog/include/lib/syslog/wire_format.h. As messages
// can be served out of order, this should only be logged if more than last
// count.
DroppedLogs uint32 `fidl_offset_v1:"28" fidl_offset_v2:"28"`
Tags []string `fidl_offset_v1:"32" fidl_offset_v2:"32" fidl_bounds:"5,63"`
Msg string `fidl_offset_v1:"48" fidl_offset_v2:"48" fidl_bounds:"32768"`
}
var _mLogMessage = _bindings.CreateLazyMarshaler(LogMessage{})
func (msg *LogMessage) Marshaler() _bindings.Marshaler {
return _mLogMessage
}
type logWithCtxListenRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
LogListener LogListenerWithCtxInterface `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4"`
Options *LogFilterOptions `fidl_offset_v1:"8" fidl_offset_v2:"8"`
}
var _mlogWithCtxListenRequest = _bindings.CreateLazyMarshaler(logWithCtxListenRequest{})
func (msg *logWithCtxListenRequest) Marshaler() _bindings.Marshaler {
return _mlogWithCtxListenRequest
}
type logWithCtxDumpLogsRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
LogListener LogListenerWithCtxInterface `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4"`
Options *LogFilterOptions `fidl_offset_v1:"8" fidl_offset_v2:"8"`
}
var _mlogWithCtxDumpLogsRequest = _bindings.CreateLazyMarshaler(logWithCtxDumpLogsRequest{})
func (msg *logWithCtxDumpLogsRequest) Marshaler() _bindings.Marshaler {
return _mlogWithCtxDumpLogsRequest
}
type logWithCtxListenSafeRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
LogListener LogListenerSafeWithCtxInterface `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4"`
Options *LogFilterOptions `fidl_offset_v1:"8" fidl_offset_v2:"8"`
}
var _mlogWithCtxListenSafeRequest = _bindings.CreateLazyMarshaler(logWithCtxListenSafeRequest{})
func (msg *logWithCtxListenSafeRequest) Marshaler() _bindings.Marshaler {
return _mlogWithCtxListenSafeRequest
}
type logWithCtxDumpLogsSafeRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
LogListener LogListenerSafeWithCtxInterface `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4"`
Options *LogFilterOptions `fidl_offset_v1:"8" fidl_offset_v2:"8"`
}
var _mlogWithCtxDumpLogsSafeRequest = _bindings.CreateLazyMarshaler(logWithCtxDumpLogsSafeRequest{})
func (msg *logWithCtxDumpLogsSafeRequest) Marshaler() _bindings.Marshaler {
return _mlogWithCtxDumpLogsSafeRequest
}
type logWithCtxListenSafeWithSelectorsRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"32" fidl_alignment_v1:"8" fidl_size_v2:"32" fidl_alignment_v2:"8"`
LogListener LogListenerSafeWithCtxInterface `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"4"`
Options *LogFilterOptions `fidl_offset_v1:"8" fidl_offset_v2:"8"`
Selectors []LogInterestSelector `fidl_offset_v1:"16" fidl_offset_v2:"16" fidl_bounds:"5"`
}
var _mlogWithCtxListenSafeWithSelectorsRequest = _bindings.CreateLazyMarshaler(logWithCtxListenSafeWithSelectorsRequest{})
func (msg *logWithCtxListenSafeWithSelectorsRequest) Marshaler() _bindings.Marshaler {
return _mlogWithCtxListenSafeWithSelectorsRequest
}
type logSinkWithCtxConnectRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Socket _zx.Socket `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"14" fidl_handle_rights:"2147483648" fidl_bounds:"0"`
}
var _mlogSinkWithCtxConnectRequest = _bindings.CreateLazyMarshaler(logSinkWithCtxConnectRequest{})
func (msg *logSinkWithCtxConnectRequest) Marshaler() _bindings.Marshaler {
return _mlogSinkWithCtxConnectRequest
}
type logSinkWithCtxConnectStructuredRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"8" fidl_alignment_v1:"8" fidl_size_v2:"8" fidl_alignment_v2:"8"`
Socket _zx.Socket `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_handle_subtype:"14" fidl_handle_rights:"2147483648" fidl_bounds:"0"`
}
var _mlogSinkWithCtxConnectStructuredRequest = _bindings.CreateLazyMarshaler(logSinkWithCtxConnectStructuredRequest{})
func (msg *logSinkWithCtxConnectStructuredRequest) Marshaler() _bindings.Marshaler {
return _mlogSinkWithCtxConnectStructuredRequest
}
type logSinkWithCtxOnRegisterInterestResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Interest fuchsiadiagnostics.Interest `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mlogSinkWithCtxOnRegisterInterestResponse = _bindings.CreateLazyMarshaler(logSinkWithCtxOnRegisterInterestResponse{})
func (msg *logSinkWithCtxOnRegisterInterestResponse) Marshaler() _bindings.Marshaler {
return _mlogSinkWithCtxOnRegisterInterestResponse
}
type logSinkWithCtxOnInterestChangedResponse struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Interest fuchsiadiagnostics.Interest `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mlogSinkWithCtxOnInterestChangedResponse = _bindings.CreateLazyMarshaler(logSinkWithCtxOnInterestChangedResponse{})
func (msg *logSinkWithCtxOnInterestChangedResponse) Marshaler() _bindings.Marshaler {
return _mlogSinkWithCtxOnInterestChangedResponse
}
type logListenerWithCtxLogRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"64" fidl_alignment_v1:"8" fidl_size_v2:"64" fidl_alignment_v2:"8"`
Log LogMessage `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mlogListenerWithCtxLogRequest = _bindings.CreateLazyMarshaler(logListenerWithCtxLogRequest{})
func (msg *logListenerWithCtxLogRequest) Marshaler() _bindings.Marshaler {
return _mlogListenerWithCtxLogRequest
}
type logListenerWithCtxLogManyRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Log []LogMessage `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_bounds:""`
}
var _mlogListenerWithCtxLogManyRequest = _bindings.CreateLazyMarshaler(logListenerWithCtxLogManyRequest{})
func (msg *logListenerWithCtxLogManyRequest) Marshaler() _bindings.Marshaler {
return _mlogListenerWithCtxLogManyRequest
}
type logListenerSafeWithCtxLogRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"64" fidl_alignment_v1:"8" fidl_size_v2:"64" fidl_alignment_v2:"8"`
Log LogMessage `fidl_offset_v1:"0" fidl_offset_v2:"0"`
}
var _mlogListenerSafeWithCtxLogRequest = _bindings.CreateLazyMarshaler(logListenerSafeWithCtxLogRequest{})
func (msg *logListenerSafeWithCtxLogRequest) Marshaler() _bindings.Marshaler {
return _mlogListenerSafeWithCtxLogRequest
}
type logListenerSafeWithCtxLogManyRequest struct {
_ struct{} `fidl:"s" fidl_size_v1:"16" fidl_alignment_v1:"8" fidl_size_v2:"16" fidl_alignment_v2:"8"`
Log []LogMessage `fidl_offset_v1:"0" fidl_offset_v2:"0" fidl_bounds:""`
}
var _mlogListenerSafeWithCtxLogManyRequest = _bindings.CreateLazyMarshaler(logListenerSafeWithCtxLogManyRequest{})
func (msg *logListenerSafeWithCtxLogManyRequest) Marshaler() _bindings.Marshaler {
return _mlogListenerSafeWithCtxLogManyRequest
}
const (
LogListenOrdinal uint64 = 0x4813203a753ef858
LogDumpLogsOrdinal uint64 = 0x4ec997e714d1bcda
LogListenSafeOrdinal uint64 = 0x4e523b04952a61b1
LogDumpLogsSafeOrdinal uint64 = 0x14e39f9cada72519
LogListenSafeWithSelectorsOrdinal uint64 = 0x1b365178771a007e
)
type LogWithCtxInterface _bindings.ChannelProxy
func (p *LogWithCtxInterface) Listen(ctx_ _bindings.Context, logListener LogListenerWithCtxInterface, options *LogFilterOptions) error {
req_ := &logWithCtxListenRequest{
LogListener: logListener,
Options: options,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogListenOrdinal, req_)
return err_
}
func (p *LogWithCtxInterface) DumpLogs(ctx_ _bindings.Context, logListener LogListenerWithCtxInterface, options *LogFilterOptions) error {
req_ := &logWithCtxDumpLogsRequest{
LogListener: logListener,
Options: options,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogDumpLogsOrdinal, req_)
return err_
}
// Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log
// message.
// A null `options` indicates no filtering is requested.
func (p *LogWithCtxInterface) ListenSafe(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions) error {
req_ := &logWithCtxListenSafeRequest{
LogListener: logListener,
Options: options,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogListenSafeOrdinal, req_)
return err_
}
// Dumps all cached logs by calling LogMany() followed by Done() on `log_listener`.
// A null `options` indicates no filtering is requested.
func (p *LogWithCtxInterface) DumpLogsSafe(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions) error {
req_ := &logWithCtxDumpLogsSafeRequest{
LogListener: logListener,
Options: options,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogDumpLogsSafeOrdinal, req_)
return err_
}
// Listens to new log entries by calling Log() on `log_listener`.
// A null `options` indicates no filtering is requested.
func (p *LogWithCtxInterface) ListenSafeWithSelectors(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions, selectors []LogInterestSelector) error {
req_ := &logWithCtxListenSafeWithSelectorsRequest{
LogListener: logListener,
Options: options,
Selectors: selectors,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogListenSafeWithSelectorsOrdinal, req_)
return err_
}
// Interface for LogListenerSafe to register to listen to logs.
type LogWithCtx interface {
Listen(ctx_ _bindings.Context, logListener LogListenerWithCtxInterface, options *LogFilterOptions) error
DumpLogs(ctx_ _bindings.Context, logListener LogListenerWithCtxInterface, options *LogFilterOptions) error
// Dumps all cached logs by calling LogMany() in batches followed by Log() for each new log
// message.
// A null `options` indicates no filtering is requested.
ListenSafe(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions) error
// Dumps all cached logs by calling LogMany() followed by Done() on `log_listener`.
// A null `options` indicates no filtering is requested.
DumpLogsSafe(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions) error
// Listens to new log entries by calling Log() on `log_listener`.
// A null `options` indicates no filtering is requested.
ListenSafeWithSelectors(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions, selectors []LogInterestSelector) error
}
type LogWithCtxTransitionalBase struct{}
func (_ *LogWithCtxTransitionalBase) ListenSafe(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions) error {
panic("Not Implemented")
}
func (_ *LogWithCtxTransitionalBase) DumpLogsSafe(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions) error {
panic("Not Implemented")
}
func (_ *LogWithCtxTransitionalBase) ListenSafeWithSelectors(ctx_ _bindings.Context, logListener LogListenerSafeWithCtxInterface, options *LogFilterOptions, selectors []LogInterestSelector) error {
panic("Not Implemented")
}
type LogWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewLogWithCtxInterfaceRequest() (LogWithCtxInterfaceRequest, *LogWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return LogWithCtxInterfaceRequest(req), (*LogWithCtxInterface)(cli), err
}
// Implements ServiceRequest.
func (_ LogWithCtxInterfaceRequest) Name() string {
return "fuchsia.logger.Log"
}
func (c LogWithCtxInterfaceRequest) ToChannel() _zx.Channel {
return c.Channel
}
const LogName = "fuchsia.logger.Log"
type LogWithCtxStub struct {
Impl LogWithCtx
}
func (s_ *LogWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case LogListenOrdinal:
in_ := logWithCtxListenRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Listen(args_.Ctx, in_.LogListener, in_.Options)
return nil, false, err_
case LogDumpLogsOrdinal:
in_ := logWithCtxDumpLogsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.DumpLogs(args_.Ctx, in_.LogListener, in_.Options)
return nil, false, err_
case LogListenSafeOrdinal:
in_ := logWithCtxListenSafeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ListenSafe(args_.Ctx, in_.LogListener, in_.Options)
return nil, false, err_
case LogDumpLogsSafeOrdinal:
in_ := logWithCtxDumpLogsSafeRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.DumpLogsSafe(args_.Ctx, in_.LogListener, in_.Options)
return nil, false, err_
case LogListenSafeWithSelectorsOrdinal:
in_ := logWithCtxListenSafeWithSelectorsRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ListenSafeWithSelectors(args_.Ctx, in_.LogListener, in_.Options, in_.Selectors)
return nil, false, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LogEventProxy _bindings.ChannelProxy
const (
LogSinkConnectOrdinal uint64 = 0x64cc4b58ae95c61b
LogSinkConnectStructuredOrdinal uint64 = 0x635424b504b2a74c
LogSinkOnRegisterInterestOrdinal uint64 = 0x1d63381c1eedaab7
LogSinkOnInterestChangedOrdinal uint64 = 0x66fd34c652fef3e
)
type LogSinkWithCtxInterface _bindings.ChannelProxy
// Send this socket to be drained.
//
// See //zircon/system/ulib/syslog/include/lib/syslog/wire_format.h for what is expected to be
// received over the socket.
func (p *LogSinkWithCtxInterface) Connect(ctx_ _bindings.Context, socket _zx.Socket) error {
req_ := &logSinkWithCtxConnectRequest{
Socket: socket,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogSinkConnectOrdinal, req_)
return err_
}
// Send this socket to be drained, using the structured logs format.
//
// See //docs/reference/diagnostics/logs/encoding.md for what is expected to be recieved over
// the socket.
func (p *LogSinkWithCtxInterface) ConnectStructured(ctx_ _bindings.Context, socket _zx.Socket) error {
req_ := &logSinkWithCtxConnectStructuredRequest{
Socket: socket,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogSinkConnectStructuredOrdinal, req_)
return err_
}
// LogSink implementers emit this event whenever the scope of their
// interest changes. Clients are expected to emit messages based on
// the registered Interest. In the event that an empty interest is
// conveyed, clients should emit messages based on their default
// (compile time) configuration.
func (p *LogSinkWithCtxInterface) ExpectOnRegisterInterest(ctx_ _bindings.Context) (fuchsiadiagnostics.Interest, error) {
resp_ := &logSinkWithCtxOnRegisterInterestResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(LogSinkOnRegisterInterestOrdinal, resp_)
return resp_.Interest, err_
}
// Use OnRegisterInterest instead.
func (p *LogSinkWithCtxInterface) ExpectOnInterestChanged(ctx_ _bindings.Context) (fuchsiadiagnostics.Interest, error) {
resp_ := &logSinkWithCtxOnInterestChangedResponse{}
err_ := ((*_bindings.ChannelProxy)(p)).Recv(LogSinkOnInterestChangedOrdinal, resp_)
return resp_.Interest, err_
}
// Drains a program's logs.
type LogSinkWithCtx interface {
// Send this socket to be drained.
//
// See //zircon/system/ulib/syslog/include/lib/syslog/wire_format.h for what is expected to be
// received over the socket.
Connect(ctx_ _bindings.Context, socket _zx.Socket) error
// Send this socket to be drained, using the structured logs format.
//
// See //docs/reference/diagnostics/logs/encoding.md for what is expected to be recieved over
// the socket.
ConnectStructured(ctx_ _bindings.Context, socket _zx.Socket) error
// LogSink implementers emit this event whenever the scope of their
// interest changes. Clients are expected to emit messages based on
// the registered Interest. In the event that an empty interest is
// conveyed, clients should emit messages based on their default
// (compile time) configuration.
// Use OnRegisterInterest instead.
}
type LogSinkWithCtxTransitionalBase struct{}
func (_ *LogSinkWithCtxTransitionalBase) ConnectStructured(ctx_ _bindings.Context, socket _zx.Socket) error {
panic("Not Implemented")
}
type LogSinkWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewLogSinkWithCtxInterfaceRequest() (LogSinkWithCtxInterfaceRequest, *LogSinkWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return LogSinkWithCtxInterfaceRequest(req), (*LogSinkWithCtxInterface)(cli), err
}
// Implements ServiceRequest.
func (_ LogSinkWithCtxInterfaceRequest) Name() string {
return "fuchsia.logger.LogSink"
}
func (c LogSinkWithCtxInterfaceRequest) ToChannel() _zx.Channel {
return c.Channel
}
const LogSinkName = "fuchsia.logger.LogSink"
type LogSinkWithCtxStub struct {
Impl LogSinkWithCtx
}
func (s_ *LogSinkWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case LogSinkConnectOrdinal:
in_ := logSinkWithCtxConnectRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Connect(args_.Ctx, in_.Socket)
return nil, false, err_
case LogSinkConnectStructuredOrdinal:
in_ := logSinkWithCtxConnectStructuredRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.ConnectStructured(args_.Ctx, in_.Socket)
return nil, false, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LogSinkEventProxy _bindings.ChannelProxy
func (p *LogSinkEventProxy) OnRegisterInterest(interest fuchsiadiagnostics.Interest) error {
event_ := &logSinkWithCtxOnRegisterInterestResponse{
Interest: interest,
}
return ((*_bindings.ChannelProxy)(p)).Send(LogSinkOnRegisterInterestOrdinal, event_)
}
func (p *LogSinkEventProxy) OnInterestChanged(interest fuchsiadiagnostics.Interest) error {
event_ := &logSinkWithCtxOnInterestChangedResponse{
Interest: interest,
}
return ((*_bindings.ChannelProxy)(p)).Send(LogSinkOnInterestChangedOrdinal, event_)
}
const (
LogListenerLogOrdinal uint64 = 0x427f2fe40ec94ab8
LogListenerLogManyOrdinal uint64 = 0x1834352f26b3e4ac
LogListenerDoneOrdinal uint64 = 0x613072ccb3e808da
)
type LogListenerWithCtxInterface _bindings.ChannelProxy
func (p *LogListenerWithCtxInterface) Log(ctx_ _bindings.Context, log LogMessage) error {
req_ := &logListenerWithCtxLogRequest{
Log: log,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogListenerLogOrdinal, req_)
return err_
}
func (p *LogListenerWithCtxInterface) LogMany(ctx_ _bindings.Context, log []LogMessage) error {
req_ := &logListenerWithCtxLogManyRequest{
Log: log,
}
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogListenerLogManyOrdinal, req_)
return err_
}
func (p *LogListenerWithCtxInterface) Done(ctx_ _bindings.Context) error {
var req_ _bindings.Message
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogListenerDoneOrdinal, req_)
return err_
}
// Included temporarily for backwards compatiblity. Use `LogListenerSafe`.
type LogListenerWithCtx interface {
Log(ctx_ _bindings.Context, log LogMessage) error
LogMany(ctx_ _bindings.Context, log []LogMessage) error
Done(ctx_ _bindings.Context) error
}
type LogListenerWithCtxTransitionalBase struct{}
type LogListenerWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewLogListenerWithCtxInterfaceRequest() (LogListenerWithCtxInterfaceRequest, *LogListenerWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return LogListenerWithCtxInterfaceRequest(req), (*LogListenerWithCtxInterface)(cli), err
}
type LogListenerWithCtxStub struct {
Impl LogListenerWithCtx
}
func (s_ *LogListenerWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case LogListenerLogOrdinal:
in_ := logListenerWithCtxLogRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Log(args_.Ctx, in_.Log)
return nil, false, err_
case LogListenerLogManyOrdinal:
in_ := logListenerWithCtxLogManyRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.LogMany(args_.Ctx, in_.Log)
return nil, false, err_
case LogListenerDoneOrdinal:
err_ := s_.Impl.Done(args_.Ctx)
return nil, false, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LogListenerEventProxy _bindings.ChannelProxy
const (
LogListenerSafeLogOrdinal uint64 = 0x51a39de355d5bd0a
LogListenerSafeLogManyOrdinal uint64 = 0x1f056431bcd626a
LogListenerSafeDoneOrdinal uint64 = 0x34986151fcb584b8
)
type LogListenerSafeWithCtxInterface _bindings.ChannelProxy
// Called for single messages.
//
// The return value is used for flow control, and implementers should acknowledge receipt of
// each message in order to continue receiving future messages.
func (p *LogListenerSafeWithCtxInterface) Log(ctx_ _bindings.Context, log LogMessage) error {
req_ := &logListenerSafeWithCtxLogRequest{
Log: log,
}
var resp_ _bindings.Message
err_ := ((*_bindings.ChannelProxy)(p)).Call(LogListenerSafeLogOrdinal, req_, resp_)
return err_
}
// Called when serving cached logs.
//
// Max logs size per call is `MAX_LOG_MANY_SIZE_BYTES` bytes.
//
// The return value is used for flow control, and implementers should acknowledge receipt of
// each batch in order to continue receiving future messages.
func (p *LogListenerSafeWithCtxInterface) LogMany(ctx_ _bindings.Context, log []LogMessage) error {
req_ := &logListenerSafeWithCtxLogManyRequest{
Log: log,
}
var resp_ _bindings.Message
err_ := ((*_bindings.ChannelProxy)(p)).Call(LogListenerSafeLogManyOrdinal, req_, resp_)
return err_
}
// Called when this listener was passed to `DumpLogsSafe()` and all cached logs have been sent.
func (p *LogListenerSafeWithCtxInterface) Done(ctx_ _bindings.Context) error {
var req_ _bindings.Message
err_ := ((*_bindings.ChannelProxy)(p)).Send(LogListenerSafeDoneOrdinal, req_)
return err_
}
// A listener who will notify the `Log` of the receipt of each message.
type LogListenerSafeWithCtx interface {
// Called for single messages.
//
// The return value is used for flow control, and implementers should acknowledge receipt of
// each message in order to continue receiving future messages.
Log(ctx_ _bindings.Context, log LogMessage) error
// Called when serving cached logs.
//
// Max logs size per call is `MAX_LOG_MANY_SIZE_BYTES` bytes.
//
// The return value is used for flow control, and implementers should acknowledge receipt of
// each batch in order to continue receiving future messages.
LogMany(ctx_ _bindings.Context, log []LogMessage) error
// Called when this listener was passed to `DumpLogsSafe()` and all cached logs have been sent.
Done(ctx_ _bindings.Context) error
}
type LogListenerSafeWithCtxTransitionalBase struct{}
type LogListenerSafeWithCtxInterfaceRequest _bindings.InterfaceRequest
func NewLogListenerSafeWithCtxInterfaceRequest() (LogListenerSafeWithCtxInterfaceRequest, *LogListenerSafeWithCtxInterface, error) {
req, cli, err := _bindings.NewInterfaceRequest()
return LogListenerSafeWithCtxInterfaceRequest(req), (*LogListenerSafeWithCtxInterface)(cli), err
}
type LogListenerSafeWithCtxStub struct {
Impl LogListenerSafeWithCtx
}
func (s_ *LogListenerSafeWithCtxStub) Dispatch(args_ _bindings.DispatchArgs) (_bindings.Message, bool, error) {
switch args_.Ordinal {
case LogListenerSafeLogOrdinal:
in_ := logListenerSafeWithCtxLogRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.Log(args_.Ctx, in_.Log)
return nil, true, err_
case LogListenerSafeLogManyOrdinal:
in_ := logListenerSafeWithCtxLogManyRequest{}
marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx)
if !ok {
return nil, false, _bindings.ErrMissingMarshalerContext
}
if _, _, err_ := _bindings.UnmarshalWithContext2(marshalerCtx, args_.Bytes, args_.HandleInfos, &in_); err_ != nil {
return nil, false, err_
}
err_ := s_.Impl.LogMany(args_.Ctx, in_.Log)
return nil, true, err_
case LogListenerSafeDoneOrdinal:
err_ := s_.Impl.Done(args_.Ctx)
return nil, false, err_
}
return nil, false, _bindings.ErrUnknownOrdinal
}
type LogListenerSafeEventProxy _bindings.ChannelProxy