forked from retoor/devplacepy
Zo doen wijdat in oost
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
)
|
||||
|
||||
type Logger struct {
|
||||
out *log.Logger
|
||||
verbose bool
|
||||
}
|
||||
|
||||
func NewLogger(w io.Writer, verbose bool) *Logger {
|
||||
return &Logger{out: log.New(w, "devplace-node ", log.LstdFlags|log.LUTC), verbose: verbose}
|
||||
}
|
||||
|
||||
func (l *Logger) Printf(format string, args ...any) {
|
||||
l.out.Output(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
|
||||
func (l *Logger) Debugf(format string, args ...any) {
|
||||
if l.verbose {
|
||||
l.out.Output(2, fmt.Sprintf(format, args...))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user