print

package
v0.0.0-...-3d7b588 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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

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

func IsJSONLogEnabled() bool

func PendingStatusEvent

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

PendingStatusEvent reports on a pending event.

func Spinner

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

func StatusEvent

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

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

WarningStatusEvent reports on a failure event.

Types

type CustomLogWriter

type CustomLogWriter struct {
	W io.Writer
}

func (CustomLogWriter) Write

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

type Result

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