formatter

package
v0.0.0-...-93fed14 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogcatFormatter

func SetLogcatFormatter(logger *logrus.Logger)

SetLogcatFormatter set the logcat formatter for given logger.

func SetTextFormatter

func SetTextFormatter(logger *logrus.Logger)

SetTextFormatter set the text formatter for given logger.

Types

type ContextHook

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

ContextHook is a custom hook for add the source information for the entry

func NewContextHook

func NewContextHook() *ContextHook

NewContextHook instantiate a new context hook

func (ContextHook) Fire

func (hook ContextHook) Fire(entry *logrus.Entry) error

Fire extend with the source information the entry.Data

func (ContextHook) Levels

func (hook ContextHook) Levels() []logrus.Level

Levels set the supported levels for this hook

type LogcatFormatter

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

LogcatFormatter formats logs into text what is fit for logcat

func NewLogcatFormatter

func NewLogcatFormatter() *LogcatFormatter

NewLogcatFormatter create new LogcatFormatter instance

func (*LogcatFormatter) Format

func (f *LogcatFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format renders a single log entry

type TextFormatter

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

TextFormatter formats logs into text with included source code's path

func NewTextFormatter

func NewTextFormatter() *TextFormatter

NewTextFormatter create new MyTextFormatter instance

func (*TextFormatter) Format

func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format renders a single log entry

Jump to

Keyboard shortcuts

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