Settting up more verbose logging with calling function and timestamp

This commit is contained in:
Christopher Talib 2020-02-07 14:52:29 +01:00
parent 2813ab0e96
commit 93f577cae9

10
main.go
View file

@ -13,6 +13,14 @@ import (
"gitlab.dcso.lolcat/LABS/styx/models"
)
func init() {
// Setting up logging.
logrus.SetFormatter(&logrus.TextFormatter{
FullTimestamp: true,
})
logrus.SetReportCaller(true)
}
func main() {
fmt.Println("Starting to get data from the Internet...")
@ -101,7 +109,7 @@ func main() {
// shodan
client := shodan.NewEnvClient(nil)
ch := make(chan *shodan.HostData)
err := client.GetBannersByPorts(context.Background(), []int{80, 443}, ch)
err := client.GetBannersByPorts(context.Background(), []int{80, 443, 8443, 53}, ch)
if err != nil {
logrus.Error(err)
}