src

Go monorepo.
Log | Files | Refs

commit e0c884408bea8087122d2e60e689ba1873aa3a61
parent deaf370595dd81764306b06fe2cec035bbe146c6
Author: dwrz <dwrz@dwrz.net>
Date:   Fri,  2 Dec 2022 14:18:21 +0000

Add log pkg

Diffstat:
Apkg/log/log.go | 20++++++++++++++++++++
1 file changed, 20 insertions(+), 0 deletions(-)

diff --git a/pkg/log/log.go b/pkg/log/log.go @@ -0,0 +1,20 @@ +package log + +import ( + "log" + "os" +) + +const flags = log.Ldate | log.Lmicroseconds | log.Lshortfile | log.LUTC + +type Logger struct { + Debug *log.Logger + Error *log.Logger +} + +func New(f *os.File) *Logger { + return &Logger{ + Debug: log.New(f, "DEBUG ", flags), + Error: log.New(f, "ERROR ", flags), + } +}