logging

package
v0.0.0-...-3c82484 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

package logging configures the golog subsystem for use with Lantern Import this to make sure golog is initialized before you log.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

Close stops logging.

func EnableFileLogging

func EnableFileLogging(logdir string)

EnableFileLogging configures golog to write to rotated files under the logdir, in addition to standard outputs.

func EnableFileLoggingWith

func EnableFileLoggingWith(werr io.WriteCloser, wout io.WriteCloser, logdir string) error

EnableFileLoggingWith is similar to EnableFileLogging but allows overriding standard outputs.

func NonStopWriteCloser

func NonStopWriteCloser(writers ...io.WriteCloser) io.WriteCloser

NonStopWriteCloser creates a WriteCloser that duplicates its writes to all the provided WriteClosers, even if errors encountered while writing. It doesn't close the provided WriteClosers.

func RegisterUserAgent

func RegisterUserAgent(agent string)

RegisterUserAgent tries to find the User-Agent in the HTTP request and keep track of the applications using Lantern during this session

func RotatedLogsUnder

func RotatedLogsUnder(logdir string) (io.WriteCloser, error)

RotatedLogsUnder creates rotated file logger under logdir.

func Timestamped

func Timestamped(w io.Writer)

Timestamped writes the current time and the duration since process start to the writer, used by golog.SetPrepender().

func ZipLogFiles

func ZipLogFiles(w io.Writer, underFolder string, maxBytes int64) error

ZipLogFiles zip the Lantern log files to the writer. All files will be placed under the folder in the archieve. It will stop and return if the newly added file would make the extracted files exceed maxBytes in total.

func ZipLogFilesFrom

func ZipLogFilesFrom(w io.Writer, maxBytes int64, dirs map[string]string) error

ZipLogFilesFrom zips the log files from the given dirs to the writer. It will stop and return if the newly added file would make the extracted files exceed maxBytes in total.

Types

This section is empty.

Jump to

Keyboard shortcuts

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