apexlogs

package
v0.0.0-...-1372329 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package apexlogs implements a handler for Apex Logs https://apex.sh/logs/.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler implementation.

func New

func New(url, projectID, authToken string, options ...Option) *Handler

New Apex Logs handler with the url, projectID, authToken and options.

func (*Handler) Close

func (h *Handler) Close()

Close flushes any pending logs, and waits for flushing to complete. This method should be called before exiting your program to ensure entries have flushed properly.

func (*Handler) Flush

func (h *Handler) Flush()

Flush any pending logs. This method is non-blocking.

func (*Handler) FlushSync

func (h *Handler) FlushSync()

FlushSync any pending logs. This method is blocking.

func (*Handler) HandleLog

func (h *Handler) HandleLog(e *log.Entry) error

HandleLog implements log.Handler.

type Option

type Option func(*Handler)

Option function.

func WithBufferOptions

func WithBufferOptions(options ...buffer.Option) Option

WithBufferOptions sets options for the underlying buffer used to batch logs.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the HTTP client used for requests.

Jump to

Keyboard shortcuts

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