log

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLoggerBuilder

func NewLoggerBuilder() builder

Types

type FLogger

type FLogger interface {
	SpinnerMessage(string)
	StartSpinner(string) error
	StopSpinner(error) error

	Info(args ...interface{})
	Infof(format string, args ...interface{})

	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
}

type FLoggerImpl

type FLoggerImpl struct {
	// contains filtered or unexported fields
}

func (*FLoggerImpl) Debug

func (l *FLoggerImpl) Debug(args ...interface{})
Example
logger, _ := NewLoggerBuilder().Build()
logger.Debug("test debug log with debug disabled")
Output:

Example (WithDebugEnabled)
logger, _ := NewLoggerBuilder().WithDebug(true).Build()
logger.Debug("test debug log with debug enabled")
Output:

DEBUG: test debug log with debug enabled

func (*FLoggerImpl) Debugf

func (l *FLoggerImpl) Debugf(format string, args ...interface{})
Example
logger, _ := NewLoggerBuilder().Build()
logger.Debugf("test debug log %s with debug disabled", "with format")
Output:

Example (WithDebugEnabled)
logger, _ := NewLoggerBuilder().WithDebug(true).Build()
logger.Debugf("test debug log %s with debug enabled", "with format")
Output:

DEBUG: test debug log with format with debug enabled

func (*FLoggerImpl) Info

func (l *FLoggerImpl) Info(args ...interface{})
Example
logger, _ := NewLoggerBuilder().Build()
logger.Info("test info log")
Output:

test info log

func (*FLoggerImpl) Infof

func (l *FLoggerImpl) Infof(format string, args ...interface{})
Example
logger, _ := NewLoggerBuilder().Build()
logger.Infof("test info log %s", "with format")
Output:

test info log with format

func (*FLoggerImpl) SpinnerMessage

func (l *FLoggerImpl) SpinnerMessage(msg string)

func (*FLoggerImpl) StartSpinner

func (l *FLoggerImpl) StartSpinner(msg string) error

func (*FLoggerImpl) StopSpinner

func (l *FLoggerImpl) StopSpinner(err error) error

Jump to

Keyboard shortcuts

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