Documentation ¶
Overview ¶
package logging configures the golog subsystem for use with Lantern Import this to make sure golog is initialized before you log.
Index ¶
- func Close() error
- func EnableFileLogging(logdir string)
- func EnableFileLoggingWith(werr io.WriteCloser, wout io.WriteCloser, logdir string) error
- func NonStopWriteCloser(writers ...io.WriteCloser) io.WriteCloser
- func RegisterUserAgent(agent string)
- func RotatedLogsUnder(logdir string) (io.WriteCloser, error)
- func Timestamped(w io.Writer)
- func ZipLogFiles(w io.Writer, underFolder string, maxBytes int64) error
- func ZipLogFilesFrom(w io.Writer, maxBytes int64, dirs map[string]string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
Timestamped writes the current time and the duration since process start to the writer, used by golog.SetPrepender().
func ZipLogFiles ¶
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.
Types ¶
This section is empty.