Documentation ¶
Index ¶
Constants ¶
const ( LevelTrace = Level(codersdk.LogLevelTrace) LevelDebug = Level(codersdk.LogLevelDebug) LevelInfo = Level(codersdk.LogLevelInfo) LevelWarn = Level(codersdk.LogLevelWarn) LevelError = Level(codersdk.LogLevelError) )
Below constants are the same as their codersdk equivalents.
Variables ¶
This section is empty.
Functions ¶
func HijackLogrus ¶
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 exposes no other way to obtain the log entries.
Types ¶
type Func ¶
func Coder ¶
func Coder(ctx context.Context, coderURL *url.URL, token string) (logger Func, closer func(), err error)
Coder establishes a connection to the Coder instance located at coderURL and authenticates using token. It then establishes a dRPC connection to the Agent API and begins sending logs. If the version of Coder does not support the Agent API, it will fall back to using the PatchLogs endpoint. The closer is used to close the logger and to wait at most logSendGracePeriod for logs to be sent. Cancelling the context will close the logs immediately without waiting for logs to be sent.