mirror of https://github.com/sirupsen/logrus.git
Associate this example with what it's an example for
This commit is contained in:
parent
39a5ad1294
commit
f9951ccddd
|
@ -9,7 +9,7 @@ import (
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
func ExampleCustomFormatter() {
|
func ExampleJSONFormatter_CallerPrettyfier() {
|
||||||
l := logrus.New()
|
l := logrus.New()
|
||||||
l.SetReportCaller(true)
|
l.SetReportCaller(true)
|
||||||
l.Out = os.Stdout
|
l.Out = os.Stdout
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
package logrus_test
|
package logrus_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type DefaultFieldHook struct {
|
type DefaultFieldHook struct {
|
||||||
|
@ -18,7 +19,7 @@ func (h *DefaultFieldHook) Fire(e *logrus.Entry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExampleDefaultField() {
|
func ExampleDefaultFieldHook() {
|
||||||
l := logrus.New()
|
l := logrus.New()
|
||||||
l.Out = os.Stdout
|
l.Out = os.Stdout
|
||||||
l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true}
|
l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true}
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
package logrus_test
|
package logrus_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -21,7 +22,7 @@ func (h *GlobalHook) Fire(e *logrus.Entry) error {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExampleGlobalVariableHook() {
|
func ExampleGlobalHook() {
|
||||||
l := logrus.New()
|
l := logrus.New()
|
||||||
l.Out = os.Stdout
|
l.Out = os.Stdout
|
||||||
l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true}
|
l.Formatter = &logrus.TextFormatter{DisableTimestamp: true, DisableColors: true}
|
||||||
|
|
Loading…
Reference in New Issue