@@ -43,29 +43,29 @@ import (
4343var PLACEHOLDER = regexp .MustCompile ("{(\\ d)}" )
4444
4545type Logger interface {
46- Fprintln (w io.Writer , format string , a ... interface {})
47- Println (format string , a ... interface {})
46+ Fprintln (w io.Writer , level string , format string , a ... interface {})
47+ Println (level string , format string , a ... interface {})
4848 Name () string
4949}
5050
5151type NoopLogger struct {}
5252
53- func (s NoopLogger ) Fprintln (w io.Writer , format string , a ... interface {}) {}
53+ func (s NoopLogger ) Fprintln (w io.Writer , level string , format string , a ... interface {}) {}
5454
55- func (s NoopLogger ) Println (format string , a ... interface {}) {}
55+ func (s NoopLogger ) Println (level string , format string , a ... interface {}) {}
5656
5757func (s NoopLogger ) Name () string {
5858 return "noop"
5959}
6060
6161type HumanLogger struct {}
6262
63- func (s HumanLogger ) Fprintln (w io.Writer , format string , a ... interface {}) {
63+ func (s HumanLogger ) Fprintln (w io.Writer , level string , format string , a ... interface {}) {
6464 fmt .Fprintln (w , Format (format , a ... ))
6565}
6666
67- func (s HumanLogger ) Println (format string , a ... interface {}) {
68- s .Fprintln (os .Stdout , Format (format , a ... ))
67+ func (s HumanLogger ) Println (level string , format string , a ... interface {}) {
68+ s .Fprintln (os .Stdout , level , Format (format , a ... ))
6969}
7070
7171func (s HumanLogger ) Name () string {
@@ -74,24 +74,24 @@ func (s HumanLogger) Name() string {
7474
7575type MachineLogger struct {}
7676
77- func (s MachineLogger ) printWithoutFormatting (w io.Writer , format string , a []interface {}) {
77+ func (s MachineLogger ) printWithoutFormatting (w io.Writer , level string , format string , a []interface {}) {
7878 a = append ([]interface {}(nil ), a ... )
7979 for idx , value := range a {
8080 typeof := reflect .Indirect (reflect .ValueOf (value )).Kind ()
8181 if typeof == reflect .String {
8282 a [idx ] = url .QueryEscape (value .(string ))
8383 }
8484 }
85- fmt .Fprintf (w , "===%s ||| %s" , format , a )
85+ fmt .Fprintf (w , "===%s ||| %s ||| %s" , level , format , a )
8686 fmt .Fprintln (w )
8787}
8888
89- func (s MachineLogger ) Fprintln (w io.Writer , format string , a ... interface {}) {
90- s .printWithoutFormatting (w , format , a )
89+ func (s MachineLogger ) Fprintln (w io.Writer , level string , format string , a ... interface {}) {
90+ s .printWithoutFormatting (w , level , format , a )
9191}
9292
93- func (s MachineLogger ) Println (format string , a ... interface {}) {
94- s .printWithoutFormatting (os .Stdout , format , a )
93+ func (s MachineLogger ) Println (level string , format string , a ... interface {}) {
94+ s .printWithoutFormatting (os .Stdout , level , format , a )
9595}
9696
9797func (s MachineLogger ) Name () string {
0 commit comments