print

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Overview

Copyright 2021 The Dapr Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

nolint

Index

Constants

View Source
const (
	LogSuccess logStatus = "success"
	LogFailure logStatus = "failure"
	LogWarning logStatus = "warning"
	LogInfo    logStatus = "info"
	LogPending logStatus = "pending"
)

Variables

View Source
var (
	Yellow    = color.New(color.FgHiYellow, color.Bold).SprintFunc()
	Green     = color.New(color.FgHiGreen, color.Bold).SprintFunc()
	Blue      = color.New(color.FgHiBlue, color.Bold).SprintFunc()
	Cyan      = color.New(color.FgCyan, color.Bold, color.Underline).SprintFunc()
	Red       = color.New(color.FgHiRed, color.Bold).Add(color.Italic).SprintFunc()
	White     = color.New(color.FgWhite).SprintFunc()
	WhiteBold = color.New(color.FgWhite, color.Bold).SprintFunc()
)

Functions

func EnableJSONFormat added in v1.1.0

func EnableJSONFormat()

func FailureStatusEvent

func FailureStatusEvent(w io.Writer, fmtstr string, a ...interface{})

FailureStatusEvent reports on a failure event.

func InfoStatusEvent

func InfoStatusEvent(w io.Writer, fmtstr string, a ...interface{})

InfoStatusEvent reports status information on an event.

func IsJSONLogEnabled added in v1.7.0

func IsJSONLogEnabled() bool

func PendingStatusEvent

func PendingStatusEvent(w io.Writer, fmtstr string, a ...interface{})

PendingStatusEvent reports on a pending event.

func Spinner added in v1.1.0

func Spinner(w io.Writer, fmtstr string, a ...interface{}) func(result Result)

func StatusEvent added in v1.10.0

func StatusEvent(w io.Writer, status logStatus, fmtstr string, a ...any)

StatusEvent reports a event log with given status.

func SuccessStatusEvent

func SuccessStatusEvent(w io.Writer, fmtstr string, a ...interface{})

SuccessStatusEvent reports on a success event.

func WarningStatusEvent added in v0.5.0

func WarningStatusEvent(w io.Writer, fmtstr string, a ...interface{})

WarningStatusEvent reports on a failure event.

Types

type CustomLogWriter added in v1.11.0

type CustomLogWriter struct {
	W io.Writer
}

func (CustomLogWriter) Write added in v1.11.0

func (c CustomLogWriter) Write(p []byte) (int, error)

type Result added in v1.1.0

type Result bool
const (
	Success Result = true
	Failure Result = false
)

Jump to

Keyboard shortcuts

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