-
Notifications
You must be signed in to change notification settings - Fork 1
/
doc.go
41 lines (41 loc) · 1.45 KB
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Package logger is the home of the Secureworks logger. The Secureworks
// logger is a unified interface for various logger implementations to
// allow an organization with multiple different logging strategies or
// needs that are implemented in different libraries to share best
// practices, tools and utilities for logging. The unified interface
// also focuses on ease of use for type-safe logging and flexible
// approaches.
//
// The Secureworks logger is also integrated with reporting hooks,
// currently Sentry, so that users can focus on generating logs and get
// such error reporting for free.
//
// Finally, the Secureworks logger makes testing assertions around
// logging easy (using the "test" testlogger driver).
//
// To use the logger you need to import the driver package you want to
// use and then generate a logger with log.Open and whatever
// configuration you want. The simplest setup would look like:
//
// package main
//
// import (
// "github.com/secureworks/logger/log"
// _ "github.com/secureworks/logger/zerolog"
// )
//
// func main() {
// config := log.DefaultConfig(nil) // os.Getenv is used by default if you pass nil.
// config.EnableErrStack = true
//
// logger, err := log.Open("zerolog", config)
// if err != nil {
// panic(err)
// }
//
// logger.Debug().Msg("logger instantiated")
// }
//
// See the examples for common use cases.
//
package logger