mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
31 lines
683 B
Go
31 lines
683 B
Go
package main
|
|
|
|
import (
|
|
"io"
|
|
"os"
|
|
|
|
"github.com/ledgerwatch/turbo-geth/cmd/restapi/commands"
|
|
"github.com/ledgerwatch/turbo-geth/log"
|
|
"github.com/mattn/go-colorable"
|
|
"github.com/mattn/go-isatty"
|
|
)
|
|
|
|
func main() {
|
|
var (
|
|
ostream log.Handler
|
|
glogger *log.GlogHandler
|
|
)
|
|
|
|
usecolor := (isatty.IsTerminal(os.Stderr.Fd()) || isatty.IsCygwinTerminal(os.Stderr.Fd())) && os.Getenv("TERM") != "dumb"
|
|
output := io.Writer(os.Stderr)
|
|
if usecolor {
|
|
output = colorable.NewColorableStderr()
|
|
}
|
|
ostream = log.StreamHandler(output, log.TerminalFormat(usecolor))
|
|
glogger = log.NewGlogHandler(ostream)
|
|
log.Root().SetHandler(glogger)
|
|
glogger.Verbosity(log.LvlInfo)
|
|
|
|
commands.Execute()
|
|
}
|