beeLogger

package
v0.0.0-...-4fd4e1f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2013 bee 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.

Index

Constants

This section is empty.

Variables

Functions

func EndLine

func EndLine() string

EndLine returns the a newline escape character

func Now

func Now(layout string) string

Now returns the current local time in the specified layout

Types

type BeeLogger

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

BeeLogger logs logging records to the specified io.Writer

func GetBeeLogger

func GetBeeLogger(w io.Writer) *BeeLogger

GetBeeLogger initializes the logger instance with a NewColorWriter output and returns a singleton

func (*BeeLogger) Critical

func (l *BeeLogger) Critical(message string)

Critical outputs a critical log message

func (*BeeLogger) Criticalf

func (l *BeeLogger) Criticalf(message string, vars ...interface{})

Criticalf outputs a formatted critical log message

func (*BeeLogger) Debug

func (l *BeeLogger) Debug(message string, file string, line int)

Debug outputs a debug log message

func (*BeeLogger) Debugf

func (l *BeeLogger) Debugf(message string, file string, line int, vars ...interface{})

Debugf outputs a formatted debug log message

func (*BeeLogger) Error

func (l *BeeLogger) Error(message string)

Error outputs an error log message

func (*BeeLogger) Errorf

func (l *BeeLogger) Errorf(message string, vars ...interface{})

Errorf outputs a formatted error log message

func (*BeeLogger) Fatal

func (l *BeeLogger) Fatal(message string)

Fatal outputs a fatal log message and exists

func (*BeeLogger) Fatalf

func (l *BeeLogger) Fatalf(message string, vars ...interface{})

Fatalf outputs a formatted log message and exists

func (*BeeLogger) Hint

func (l *BeeLogger) Hint(message string)

Hint outputs a hint log message

func (*BeeLogger) Hintf

func (l *BeeLogger) Hintf(message string, vars ...interface{})

Hintf outputs a formatted hint log message

func (*BeeLogger) Info

func (l *BeeLogger) Info(message string)

Info outputs an information log message

func (*BeeLogger) Infof

func (l *BeeLogger) Infof(message string, vars ...interface{})

Infof outputs a formatted information log message

func (*BeeLogger) SetOutput

func (l *BeeLogger) SetOutput(w io.Writer)

SetOutput sets the logger output destination

func (*BeeLogger) Success

func (l *BeeLogger) Success(message string)

Success outputs a success log message

func (*BeeLogger) Successf

func (l *BeeLogger) Successf(message string, vars ...interface{})

Successf outputs a formatted success log message

func (*BeeLogger) Warn

func (l *BeeLogger) Warn(message string)

Warn outputs a warning log message

func (*BeeLogger) Warnf

func (l *BeeLogger) Warnf(message string, vars ...interface{})

Warnf outputs a formatted warning log message

type LogRecord

type LogRecord struct {
	ID       string
	Level    string
	Message  string
	Filename string
	LineNo   int
}

LogRecord represents a log record and contains the timestamp when the record was created, an increasing id, level and the actual formatted log line.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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