logging

package module
v0.0.0-...-a418af8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2023 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Logging: wasmcloud built-in logging capability provider

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoggingContractId

func LoggingContractId() string

LoggingContractId returns the capability contract id for this interface

func LoggingHandler

func LoggingHandler(actor_ Logging) actor.Handler

LoggingHandler is called by an actor during `main` to generate a dispatch handler The output of this call should be passed into `actor.RegisterHandlers`

Types

type LogEntry

type LogEntry struct {
	// severity level: debug,info,warn,error
	Level string
	// message to log
	Text string
}

func CDecodeLogEntry

func CDecodeLogEntry(d *cbor.Decoder) (LogEntry, error)

CDecodeLogEntry deserializes a LogEntry using cbor

func MDecodeLogEntry

func MDecodeLogEntry(d *msgpack.Decoder) (LogEntry, error)

MDecodeLogEntry deserializes a LogEntry using msgpack

func (*LogEntry) CEncode

func (o *LogEntry) CEncode(encoder cbor.Writer) error

CEncode serializes a LogEntry using cbor

func (*LogEntry) MEncode

func (o *LogEntry) MEncode(encoder msgpack.Writer) error

MEncode serializes a LogEntry using msgpack

type Logging

type Logging interface {
	//
	// WriteLog - log a text message
	//
	WriteLog(ctx *actor.Context, arg LogEntry) error
}

type LoggingReceiver

type LoggingReceiver struct{}

LoggingReceiver receives messages defined in the Logging service interface

func (*LoggingReceiver) Dispatch

func (r *LoggingReceiver) Dispatch(ctx *actor.Context, svc interface{}, message *actor.Message) (*actor.Message, error)

type LoggingSender

type LoggingSender struct {
	// contains filtered or unexported fields
}

LoggingSender sends messages to a Logging service

func NewProviderLogging

func NewProviderLogging() *LoggingSender

NewProvider constructs a client for sending to a Logging provider implementing the 'wasmcloud:builtin:logging' capability contract, with the "default" link

func NewProviderLoggingLink(linkName string) *LoggingSender

NewProviderLoggingLink constructs a client for sending to a Logging provider implementing the 'wasmcloud:builtin:logging' capability contract, with the specified link name

func (*LoggingSender) WriteLog

func (s *LoggingSender) WriteLog(ctx *actor.Context, arg LogEntry) error

WriteLog - log a text message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL