slogger

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2019 License: MIT Imports: 7 Imported by: 2

Documentation

Overview

Package slogger is a combination of Zap and Sentry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(message string)

Debug logs additional messages, these are interesting for debugging the application.

func EpochTimeEncoderInt64

func EpochTimeEncoderInt64(t time.Time, enc zapcore.PrimitiveArrayEncoder)

EpochTimeEncoderInt64 is a time encoder for Zap that encodes time to int64 instead of float64.

func Error

func Error(message string)

Error logs errors that happened, this impacted the process and need to be looked at.

func Fatal

func Fatal(message string)

Fatal logs fatal errors, when this happens the process has stopped. This is worst case scenario.

func Info

func Info(message string)

Info logs informational messages, these are not really interesting and could be ignored.

func SetConfig added in v0.2.0

func SetConfig(c Config)

SetConfig sets the cfg var to the given Config.

func Warning

func Warning(message string)

Warning logs things that went wrong but are not impacting the process, but it should be looked at.

Types

type Config added in v0.2.0

type Config struct {
	Level  string
	Sentry SentryZapOptions
	Loggly LogglyZapOptions
}

type LogglyZap added in v0.2.0

type LogglyZap struct {
	Message string
	Client  *loggly.Client
	Options LogglyZapOptions
}

func (LogglyZap) Sync added in v0.2.0

func (l LogglyZap) Sync() error

Sync sends the message that resides in LogglyZap.Message to Loggly if it's not empty.

func (LogglyZap) Write added in v0.2.0

func (l LogglyZap) Write(data []byte) (n int, err error)

Write writes the given bytes to LogglyZap.Message as a string.

type LogglyZapOptions added in v0.2.0

type LogglyZapOptions struct {
	Enabled bool
	Token   string
}

type SentryZap

type SentryZap struct {
	Message string
	Options SentryZapOptions
}

func (SentryZap) Sync added in v0.2.0

func (s SentryZap) Sync() error

Sync sends the message that resides in SentryZap.Message to Senty if it's not empty.

func (SentryZap) Write added in v0.2.0

func (s SentryZap) Write(data []byte) (n int, err error)

Write writes the given bytes to SentryZap.Message as a string.

type SentryZapOptions added in v0.2.0

type SentryZapOptions struct {
	Enabled bool
	Dsn     string
}

Jump to

Keyboard shortcuts

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