Movatterモバイル変換


[0]ホーム

URL:


log

package
v1.1.0Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License:Apache-2.0Imports:19Imported by:0

Details

Repository

github.com/coder/envbuilder

Links

Documentation

Index

Constants

Below constants are the same as their codersdk equivalents.

Variables

This section is empty.

Functions

funcHijackLogrus

func HijackLogrus(lvlLevel, callback func(entry *logrus.Entry))

HijackLogrus hijacks the logrus logger and calls the callback for each log entry.This is an abuse of logrus, the package that Kaniko uses, but it exposesno other way to obtain the log entries.

funcToLogrus

func ToLogrus(lvlLevel)logrus.Level

funcWriter

func Writer(logfFunc) (io.Writer, func())

Writer returns an io.Writer that logs all writes in a separate goroutine.It is the responsibility of the caller to call the returnedfunction to stop the goroutine.

Types

typeFunc

type Func func(lLevel, msgstring, args ...any)

funcCoder

func Coder(ctxcontext.Context, coderURL *url.URL, tokenstring) (loggerFunc, closer func(), errerror)

Coder establishes a connection to the Coder instance located at coderURL andauthenticates using token. It then establishes a dRPC connection to the AgentAPI and begins sending logs. If the version of Coder does not support theAgent API, it will fall back to using the PatchLogs endpoint. The closer isused to close the logger and to wait at most logSendGracePeriod for logs tobe sent. Cancelling the context will close the logs immediately withoutwaiting for logs to be sent.

funcNew

func New(wio.Writer, verbosebool)Func

New logs to the provided io.Writer.

funcWrap

func Wrap(fs ...Func)Func

Wrap wraps the provided LogFuncs into a single Func.

typeLevel

type Levelstring

funcFromLogrus

func FromLogrus(lvllogrus.Level)Level

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp