mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-18 13:25:26 +00:00
32 lines
625 B
Go
32 lines
625 B
Go
|
|
package goconsole
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/dop251/goja_nodejs/console"
|
||
|
|
"github.com/projectdiscovery/gologger"
|
||
|
|
)
|
||
|
|
|
||
|
|
var _ console.Printer = &GoConsolePrinter{}
|
||
|
|
|
||
|
|
// GoConsolePrinter is a console printer for nuclei using gologger
|
||
|
|
type GoConsolePrinter struct {
|
||
|
|
logger *gologger.Logger
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewGoConsolePrinter() *GoConsolePrinter {
|
||
|
|
return &GoConsolePrinter{
|
||
|
|
logger: gologger.DefaultLogger,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *GoConsolePrinter) Log(msg string) {
|
||
|
|
p.logger.Info().Msg(msg)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *GoConsolePrinter) Warn(msg string) {
|
||
|
|
p.logger.Warning().Msg(msg)
|
||
|
|
}
|
||
|
|
|
||
|
|
func (p *GoConsolePrinter) Error(msg string) {
|
||
|
|
p.logger.Error().Msg(msg)
|
||
|
|
}
|