Documentation ¶
Index ¶
- Variables
- func CriticalIf(ctx context.Context, err error)
- func EnableJSON()
- func EnableQuiet()
- func Fatal(err error, msg string, data ...interface{})
- func FatalIf(err error, msg string, data ...interface{})
- func Info(msg string, data ...interface{})
- func Init(goPath string, goRoot string)
- func LogIf(ctx context.Context, err error)
- func LogOnceIf(ctx context.Context, err error, id interface{})
- func RegisterUIError(f func(string, error, bool) string)
- func SetReqInfo(ctx context.Context, req *ReqInfo) context.Context
- func StartupMessage(msg string, data ...interface{})
- type Console
- type KeyVal
- type Level
- type ReqInfo
Constants ¶
This section is empty.
Variables ¶
var Disable = false
Disable disables all logging, false by default. (used for "go test")
var ErrCritical struct{}
ErrCritical is the value panic'd whenever CriticalIf is called.
Functions ¶
func CriticalIf ¶
CriticalIf logs the provided error on the console. It fails the current go-routine by causing a `panic(ErrCritical)`.
func Fatal ¶
Fatal prints only fatal error message without no stack trace it will be called for input validation failures
func Init ¶
Init sets the trimStrings to possible GOPATHs and GOROOT directories. Also append github.com/piensa/nodo This is done to clean up the filename, when stack trace is displayed when an error happens.
func LogOnceIf ¶
LogOnceIf - Logs notification errors - once per error. id is a unique identifier for related log messages, refer to cmd/notification.go on how it is used.
func RegisterUIError ¶
RegisterUIError registers the specified rendering function. This latter will be called for a pretty rendering of fatal errors.
func SetReqInfo ¶
SetReqInfo sets ReqInfo in the context.
Types ¶
type Console ¶
type Console interface {
// contains filtered or unexported methods
}
Console interface describes the methods that needs to be implemented to satisfy the interface requirements.
type ReqInfo ¶
type ReqInfo struct { RemoteHost string // Client Host/IP UserAgent string // User Agent RequestID string // x-amz-request-id API string // API name - GetObject PutObject NewMultipartUpload etc. BucketName string // Bucket name ObjectName string // Object name sync.RWMutex // contains filtered or unexported fields }
ReqInfo stores the request info.
func NewReqInfo ¶
NewReqInfo :
func (*ReqInfo) AppendTags ¶
AppendTags - appends key/val to ReqInfo.tags