logs

package
v0.7.11 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2023, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2022, Unikraft GmbH and The KraftKit Authors. Licensed under the BSD-3-Clause License (the "License"). You may not use this file except in compliance with the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FollowLogs added in v0.7.2

func FollowLogs(ctx context.Context, machine *machineapi.Machine, controller machineapi.MachineService, consumer LogConsumer) error

FollowLogs tracks the logs generated by a machine and prints them to the context out stream.

func NewCmd

func NewCmd() *cobra.Command

func NewColorfulConsumer added in v0.7.2

func NewColorfulConsumer(streams *iostreams.IOStreams, color bool, prefix string) (*colorfulConsumer, error)

NewColorfulConsumer creates a new log consumer which prefixes each line with a colorful prefix.

Types

type LogConsumer added in v0.7.3

type LogConsumer interface {
	Consume(line string) error
}

type LogOptions

type LogOptions struct {
	Follow     bool   `long:"follow" short:"f" usage:"Follow log output"`
	Platform   string `noattribute:"true"`
	Prefix     string `long:"prefix" usage:"Prefix each log line with the given string"`
	PrefixName bool   `long:"prefix-name" usage:"Prefix each log line with the machine name"`
}

func (*LogOptions) Pre

func (opts *LogOptions) Pre(cmd *cobra.Command, _ []string) error

func (*LogOptions) Run

func (opts *LogOptions) Run(ctx context.Context, args []string) error

Jump to

Keyboard shortcuts

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