Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/js/libs/goconsole/log.go
2846 views
1
package goconsole
2
3
import (
4
"github.com/Mzack9999/goja_nodejs/console"
5
"github.com/projectdiscovery/gologger"
6
)
7
8
var _ console.Printer = &GoConsolePrinter{}
9
10
// GoConsolePrinter is a console printer for nuclei using gologger
11
type GoConsolePrinter struct {
12
logger *gologger.Logger
13
}
14
15
func NewGoConsolePrinter() *GoConsolePrinter {
16
return &GoConsolePrinter{
17
logger: gologger.DefaultLogger,
18
}
19
}
20
21
func (p *GoConsolePrinter) Log(msg string) {
22
p.logger.Info().Msg(msg)
23
}
24
25
func (p *GoConsolePrinter) Warn(msg string) {
26
p.logger.Warning().Msg(msg)
27
}
28
29
func (p *GoConsolePrinter) Error(msg string) {
30
p.logger.Error().Msg(msg)
31
}
32
33