logger

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ConsoleType = "console"

ConsoleType defines console logger type name

View Source
const FileType = "file"

FileType defines file logger type name

View Source
const RedisType = "redis"

RedisType defines redis logger type name

Variables

This section is empty.

Functions

func Serialize

func Serialize(path string, logs []Logs) error

Serialize dumps logs array into a json file

Types

type Logs

type Logs struct {
	Type string    `json:"type"`
	Data LogsRedis `json:"data"`
}

Logs defines a custom backend with variable settings

func Deserialize

func Deserialize(path string) ([]Logs, error)

Deserialize reads json from disks and returns []Logs

type LogsRedis

type LogsRedis struct {
	// Stdout is the redis url for stdout (redis://host/channel)
	Stdout string `json:"stdout"`

	// Stderr is the redis url for stderr (redis://host/channel)
	Stderr string `json:"stderr"`
}

LogsRedis defines how to connect a redis logs backend

Jump to

Keyboard shortcuts

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