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
- Variables
- func EnableJSONFormat()
- func FailureStatusEvent(w io.Writer, fmtstr string, a ...interface{})
- func InfoStatusEvent(w io.Writer, fmtstr string, a ...interface{})
- func IsJSONLogEnabled() bool
- func PendingStatusEvent(w io.Writer, fmtstr string, a ...interface{})
- func Spinner(w io.Writer, fmtstr string, a ...interface{}) func(result Result)
- func StatusEvent(w io.Writer, status logStatus, fmtstr string, a ...any)
- func SuccessStatusEvent(w io.Writer, fmtstr string, a ...interface{})
- func WarningStatusEvent(w io.Writer, fmtstr string, a ...interface{})
- type Result
Constants ¶
const ( LogSuccess logStatus = "success" LogFailure logStatus = "failure" LogWarning logStatus = "warning" LogInfo logStatus = "info" LogPending logStatus = "pending" )
Variables ¶
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 ¶
FailureStatusEvent reports on a failure event.
func InfoStatusEvent ¶
InfoStatusEvent reports status information on an event.
func IsJSONLogEnabled ¶ added in v1.7.0
func IsJSONLogEnabled() bool
func PendingStatusEvent ¶
PendingStatusEvent reports on a pending event.
func StatusEvent ¶ added in v1.10.0
StatusEvent reports a event log with given status.
func SuccessStatusEvent ¶
SuccessStatusEvent reports on a success event.
func WarningStatusEvent ¶ added in v0.5.0
WarningStatusEvent reports on a failure event.