Skip to content

phuhao00/spoor

Repository files navigation

spoor

make logger switchable and adapted project

💡 Usage

You can import spoor using:

import (
    "github.com/phuhao00/spoor"
)

Then use one of the helpers below:

fileWriter

fileWriter := spoor.NewFileWriter("log", 0, 0, 0)
l := spoor.NewSpoor(spoor.DEBUG, "", log.Ldate|log.Ltime|log.Lmicroseconds|log.Llongfile, spoor.WithFileWriter(fileWriter))
l.DebugF("hhhh")
select {}

consoleWriter

l := NewSpoor(DEBUG, "", log.Ldate|log.Ltime|log.Lmicroseconds|log.Llongfile, WithNormalWriter(os.Stdout))
l.DebugF("hhhh")

elasticWriter

clickHouseWriter

logbusWriter