| // 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. |
| |
| // WARNING: This file is machine generated by fidlgen. |
| |
| package logger |
| |
| import ( |
| _zx "syscall/zx" |
| fuchsiadiagnostics "syscall/zx/diagnostics" |
| _bindings "syscall/zx/fidl" |
| ) |
| |
| const ( |
| // Default log level used to initialize loggers. |
| LogLevelDefault LogLevelFilter = LogLevelFilterInfo |
| // Maximum available log severity. |
| LogSeverityMaxStep uint8 = 6 |
| // The interval between discrete log severity levels |
| LogSeverityStepSize uint8 = 16 |
| // The interval between discrete log verbosity levels |
| LogVerbosityStepSize uint8 = 1 |
| // Max byte size for message payload. |
| MaxDatagramLenBytes uint32 = 32768 |
| // Max log bytes per call to a listener. |
| MaxLogManySizeBytes uint64 = 16384 |
| // Max number of tags that can be passed to filter by listener. |
| MaxTags uint8 = 16 |
| // Max tags that will be attached to a LogMessage. |
| MaxTagsPerLogMessage uint8 = 5 |
| // Max tag length that can be passed to filter by listener. |
| MaxTagLenBytes uint8 = 63 |
| ) |
| |
| var _ _bindings.Enum = InterestChangeError(0) |
| |
| type InterestChangeError uint32 |
| |
| const ( |
| |
| // Incorrectly called WaitForInterestChange twice |
| // without waiting for the first call to return. |
| InterestChangeErrorCalledTwice InterestChangeError = 1 |
| ) |
| |
| func (_ InterestChangeError) I_EnumValues() []InterestChangeError { |
| return []InterestChangeError{ |
| InterestChangeErrorCalledTwice, |
| } |
| } |
| |
| func (_ InterestChangeError) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x InterestChangeError) IsUnknown() bool { |
| switch x { |
| case 1: |
| return false |
| } |
| return true |
| } |
| |
| func (x InterestChangeError) String() string { |
| switch x { |
| case 1: |
| return "CalledTwice" |
| } |
| return "Unknown" |
| } |
| |
| 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 ( |
| 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{ |
| LogLevelFilterTrace, |
| LogLevelFilterDebug, |
| LogLevelFilterInfo, |
| LogLevelFilterWarn, |
| LogLevelFilterError, |
| LogLevelFilterFatal, |
| LogLevelFilterNone, |
| } |
| } |
| |
| func (_ LogLevelFilter) I_EnumIsStrict() bool { |
| return true |
| } |
| |
| func (x LogLevelFilter) IsUnknown() bool { |
| switch x { |
| 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 |
| } |
| return true |
| } |
| |
| func (x LogLevelFilter) String() string { |
| switch x { |
| 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 LogDumpLogsSafeRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| LogListener LogListenerSafeWithCtxInterface `fidl_offset_v2:"0" fidl_handle_subtype:"4"` |
| Options *LogFilterOptions `fidl_offset_v2:"8"` |
| } |
| |
| var _mLogDumpLogsSafeRequest = _bindings.CreateLazyMarshaler(LogDumpLogsSafeRequest{}) |
| |
| func (msg *LogDumpLogsSafeRequest) Marshaler() _bindings.Marshaler { |
| return _mLogDumpLogsSafeRequest |
| } |
| |
| type LogFilterOptions struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"56" fidl_alignment_v2:"8"` |
| FilterByPid bool `fidl_offset_v2:"0"` |
| Pid uint64 `fidl_offset_v2:"8"` |
| FilterByTid bool `fidl_offset_v2:"16"` |
| Tid uint64 `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_v2:"32"` |
| // Severity used as threshold to determine logging level. |
| MinSeverity LogLevelFilter `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_v2:"40" fidl_bounds:"16,63"` |
| } |
| |
| var _mLogFilterOptions = _bindings.CreateLazyMarshaler(LogFilterOptions{}) |
| |
| func (msg *LogFilterOptions) Marshaler() _bindings.Marshaler { |
| return _mLogFilterOptions |
| } |
| |
| type LogListenSafeRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| LogListener LogListenerSafeWithCtxInterface `fidl_offset_v2:"0" fidl_handle_subtype:"4"` |
| Options *LogFilterOptions `fidl_offset_v2:"8"` |
| } |
| |
| var _mLogListenSafeRequest = _bindings.CreateLazyMarshaler(LogListenSafeRequest{}) |
| |
| func (msg *LogListenSafeRequest) Marshaler() _bindings.Marshaler { |
| return _mLogListenSafeRequest |
| } |
| |
| type LogListenSafeWithSelectorsRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"32" fidl_alignment_v2:"8"` |
| LogListener LogListenerSafeWithCtxInterface `fidl_offset_v2:"0" fidl_handle_subtype:"4"` |
| Options *LogFilterOptions `fidl_offset_v2:"8"` |
| Selectors []fuchsiadiagnostics.LogInterestSelector `fidl_offset_v2:"16" fidl_bounds:"64"` |
| } |
| |
| var _mLogListenSafeWithSelectorsRequest = _bindings.CreateLazyMarshaler(LogListenSafeWithSelectorsRequest{}) |
| |
| func (msg *LogListenSafeWithSelectorsRequest) Marshaler() _bindings.Marshaler { |
| return _mLogListenSafeWithSelectorsRequest |
| } |
| |
| type LogListenerSafeLogManyRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| Log []LogMessage `fidl_offset_v2:"0" fidl_bounds:""` |
| } |
| |
| var _mLogListenerSafeLogManyRequest = _bindings.CreateLazyMarshaler(LogListenerSafeLogManyRequest{}) |
| |
| func (msg *LogListenerSafeLogManyRequest) Marshaler() _bindings.Marshaler { |
| return _mLogListenerSafeLogManyRequest |
| } |
| |
| type LogListenerSafeLogRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"64" fidl_alignment_v2:"8"` |
| Log LogMessage `fidl_offset_v2:"0"` |
| } |
| |
| var _mLogListenerSafeLogRequest = _bindings.CreateLazyMarshaler(LogListenerSafeLogRequest{}) |
| |
| func (msg *LogListenerSafeLogRequest) Marshaler() _bindings.Marshaler { |
| return _mLogListenerSafeLogRequest |
| } |
| |
| type LogMessage struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"64" fidl_alignment_v2:"8"` |
| Pid uint64 `fidl_offset_v2:"0"` |
| Tid uint64 `fidl_offset_v2:"8"` |
| // [zx_clock_get_monotonic](https://fuchsia.dev/fuchsia-src/reference/syscalls/clock_get_monotonic.md) |
| Time int64 `fidl_offset_v2:"16"` |
| Severity int32 `fidl_offset_v2:"24"` |
| // See [wire_format.h](https://cs.opensource.google/fuchsia/fuchsia/+/main: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_v2:"28"` |
| Tags []string `fidl_offset_v2:"32" fidl_bounds:"5,63"` |
| Msg string `fidl_offset_v2:"48" fidl_bounds:"32768"` |
| } |
| |
| var _mLogMessage = _bindings.CreateLazyMarshaler(LogMessage{}) |
| |
| func (msg *LogMessage) Marshaler() _bindings.Marshaler { |
| return _mLogMessage |
| } |
| |
| type LogSinkConnectRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Socket _zx.Socket `fidl_offset_v2:"0" fidl_handle_subtype:"14" fidl_handle_rights:"2147483648" fidl_bounds:"0"` |
| } |
| |
| var _mLogSinkConnectRequest = _bindings.CreateLazyMarshaler(LogSinkConnectRequest{}) |
| |
| func (msg *LogSinkConnectRequest) Marshaler() _bindings.Marshaler { |
| return _mLogSinkConnectRequest |
| } |
| |
| type LogSinkConnectStructuredRequest struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"4" fidl_alignment_v2:"4"` |
| Socket _zx.Socket `fidl_offset_v2:"0" fidl_handle_subtype:"14" fidl_handle_rights:"2147483648" fidl_bounds:"0"` |
| } |
| |
| var _mLogSinkConnectStructuredRequest = _bindings.CreateLazyMarshaler(LogSinkConnectStructuredRequest{}) |
| |
| func (msg *LogSinkConnectStructuredRequest) Marshaler() _bindings.Marshaler { |
| return _mLogSinkConnectStructuredRequest |
| } |
| |
| type LogSinkWaitForInterestChangeResponse struct { |
| _ struct{} `fidl:"s" fidl_size_v2:"16" fidl_alignment_v2:"8"` |
| Data fuchsiadiagnostics.Interest `fidl_offset_v2:"0"` |
| } |
| |
| var _mLogSinkWaitForInterestChangeResponse = _bindings.CreateLazyMarshaler(LogSinkWaitForInterestChangeResponse{}) |
| |
| func (msg *LogSinkWaitForInterestChangeResponse) Marshaler() _bindings.Marshaler { |
| return _mLogSinkWaitForInterestChangeResponse |
| } |
| |
| type I_logSinkWaitForInterestChangeResultTag uint64 |
| |
| const ( |
| LogSinkWaitForInterestChangeResultResponse = 1 // 0x00000001 |
| LogSinkWaitForInterestChangeResultErr = 2 // 0x00000002 |
| ) |
| |
| type LogSinkWaitForInterestChangeResult struct { |
| I_logSinkWaitForInterestChangeResultTag `fidl:"x!" fidl_size_v2:"16" fidl_alignment_v2:"8" fidl_resource:"false"` |
| Response LogSinkWaitForInterestChangeResponse `fidl_ordinal:"1"` |
| Err InterestChangeError `fidl_ordinal:"2"` |
| } |
| |
| var _mLogSinkWaitForInterestChangeResult = _bindings.CreateLazyMarshaler(LogSinkWaitForInterestChangeResult{}) |
| |
| func (msg *LogSinkWaitForInterestChangeResult) Marshaler() _bindings.Marshaler { |
| return _mLogSinkWaitForInterestChangeResult |
| } |
| |
| func (_m *LogSinkWaitForInterestChangeResult) reset() { |
| switch _m.I_logSinkWaitForInterestChangeResultTag { |
| case 1: |
| var _zeroed LogSinkWaitForInterestChangeResponse |
| _m.Response = _zeroed |
| case 2: |
| var _zeroed InterestChangeError |
| _m.Err = _zeroed |
| } |
| } |
| |
| func (_m *LogSinkWaitForInterestChangeResult) Which() I_logSinkWaitForInterestChangeResultTag { |
| return _m.I_logSinkWaitForInterestChangeResultTag |
| } |
| |
| func (_m *LogSinkWaitForInterestChangeResult) Ordinal() uint64 { |
| return uint64(_m.I_logSinkWaitForInterestChangeResultTag) |
| } |
| |
| func (_m *LogSinkWaitForInterestChangeResult) SetResponse(response LogSinkWaitForInterestChangeResponse) { |
| _m.reset() |
| _m.I_logSinkWaitForInterestChangeResultTag = LogSinkWaitForInterestChangeResultResponse |
| _m.Response = response |
| } |
| |
| func LogSinkWaitForInterestChangeResultWithResponse(response LogSinkWaitForInterestChangeResponse) LogSinkWaitForInterestChangeResult { |
| var _u LogSinkWaitForInterestChangeResult |
| _u.SetResponse(response) |
| return _u |
| } |
| |
| func (_m *LogSinkWaitForInterestChangeResult) SetErr(err InterestChangeError) { |
| _m.reset() |
| _m.I_logSinkWaitForInterestChangeResultTag = LogSinkWaitForInterestChangeResultErr |
| _m.Err = err |
| } |
| |
| func LogSinkWaitForInterestChangeResultWithErr(err InterestChangeError) LogSinkWaitForInterestChangeResult { |
| var _u LogSinkWaitForInterestChangeResult |
| _u.SetErr(err) |
| return _u |
| } |
| |
| const ( |
| LogListenSafeOrdinal uint64 = 0x4e523b04952a61b1 |
| LogDumpLogsSafeOrdinal uint64 = 0x14e39f9cada72519 |
| LogListenSafeWithSelectorsOrdinal uint64 = 0x1b365178771a007e |
| ) |
| |
| type LogWithCtxInterface _bindings.ChannelProxy |
| |
| // 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_ := &LogListenSafeRequest{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_ := &LogDumpLogsSafeRequest{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 []fuchsiadiagnostics.LogInterestSelector) error { |
| req_ := &LogListenSafeWithSelectorsRequest{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 { |
| // 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 []fuchsiadiagnostics.LogInterestSelector) error |
| } |
| |
| type LogWithCtxTransitionalBase struct{} |
| |
| 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 LogListenSafeOrdinal: |
| in_ := &LogListenSafeRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(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_ := &LogDumpLogsSafeRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(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_ := &LogListenSafeWithSelectorsRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(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 ( |
| 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_ := &LogListenerSafeLogRequest{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_ := &LogListenerSafeLogManyRequest{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_ := &LogListenerSafeLogRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(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_ := &LogListenerSafeLogManyRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(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 |
| |
| const ( |
| LogSinkConnectOrdinal uint64 = 0x64cc4b58ae95c61b |
| LogSinkWaitForInterestChangeOrdinal uint64 = 0x1dad20560c197242 |
| LogSinkConnectStructuredOrdinal uint64 = 0x635424b504b2a74c |
| ) |
| |
| type LogSinkWithCtxInterface _bindings.ChannelProxy |
| |
| // Send this socket to be drained. |
| // |
| // See [wire_format.h](https://cs.opensource.google/fuchsia/fuchsia/+/main: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_ := &LogSinkConnectRequest{Socket: socket} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(LogSinkConnectOrdinal, req_) |
| return err_ |
| } |
| |
| // LogSink implementers will return to this hanging-get 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 |
| // e.g. compile time configuration. Each client may only poll this once at a time. |
| // Invoking WaitForInterestChange a second time before the first call returns will |
| // result in an error being returned. |
| func (p *LogSinkWithCtxInterface) WaitForInterestChange(ctx_ _bindings.Context) (LogSinkWaitForInterestChangeResult, error) { |
| var req_ _bindings.Message |
| resp_ := &LogSinkWaitForInterestChangeResult{} |
| err_ := ((*_bindings.ChannelProxy)(p)).Call(LogSinkWaitForInterestChangeOrdinal, req_, resp_) |
| return (*resp_), err_ |
| } |
| |
| // Send this socket to be drained, using the structured logs format. |
| // |
| // See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding) |
| // for what is expected to be received over the socket. |
| func (p *LogSinkWithCtxInterface) ConnectStructured(ctx_ _bindings.Context, socket _zx.Socket) error { |
| req_ := &LogSinkConnectStructuredRequest{Socket: socket} |
| err_ := ((*_bindings.ChannelProxy)(p)).Send(LogSinkConnectStructuredOrdinal, req_) |
| return err_ |
| } |
| |
| // Drains a program's logs. |
| type LogSinkWithCtx interface { |
| // Send this socket to be drained. |
| // |
| // See [wire_format.h](https://cs.opensource.google/fuchsia/fuchsia/+/main: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 |
| // LogSink implementers will return to this hanging-get 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 |
| // e.g. compile time configuration. Each client may only poll this once at a time. |
| // Invoking WaitForInterestChange a second time before the first call returns will |
| // result in an error being returned. |
| WaitForInterestChange(ctx_ _bindings.Context) (LogSinkWaitForInterestChangeResult, error) |
| // Send this socket to be drained, using the structured logs format. |
| // |
| // See [Encoding structured records](https://fuchsia.dev/fuchsia-src/reference/platform-spec/diagnostics/logs-encoding) |
| // for what is expected to be received over the socket. |
| ConnectStructured(ctx_ _bindings.Context, socket _zx.Socket) error |
| } |
| |
| type LogSinkWithCtxTransitionalBase struct{} |
| |
| 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_ := &LogSinkConnectRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(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 LogSinkWaitForInterestChangeOrdinal: |
| payload, err_ := s_.Impl.WaitForInterestChange(args_.Ctx) |
| out_ := &payload |
| return out_, true, err_ |
| case LogSinkConnectStructuredOrdinal: |
| in_ := &LogSinkConnectStructuredRequest{} |
| marshalerCtx, ok := _bindings.GetMarshalerContext(args_.Ctx) |
| if !ok { |
| return nil, false, _bindings.ErrMissingMarshalerContext |
| } |
| if err_ := _bindings.Unmarshal(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 |