Disabling logs support added.

This commit is contained in:
Musab Gültekin 2019-06-09 19:14:46 +03:00
parent b973c1c064
commit 7abc7a370d
3 changed files with 9 additions and 1 deletions

View File

@ -12,6 +12,7 @@ Geziyor is a blazing fast web crawling and web scraping framework, used to crawl
- Request Delays (Constant/Randomized)
- Automatic response decoding to UTF-8
See scraper [Options](https://godoc.org/github.com/geziyor/geziyor#Options) for customization.
## Usage
Simplest usage
@ -53,4 +54,5 @@ geziyor.Start()
go get github.com/geziyor/geziyor
We highly recommend you to use go modules. As this project is in **development stage** right now.
## Status
We highly recommend you to use go modules. As this project is in **development stage** right now and **API is not stable**.

View File

@ -62,6 +62,9 @@ func NewGeziyor(opt Options) *Geziyor {
if opt.UserAgent == "" {
geziyor.opt.UserAgent = "Geziyor 1.0"
}
if opt.LogDisabled {
log.SetOutput(ioutil.Discard)
}
return geziyor
}

View File

@ -37,4 +37,7 @@ type Options struct {
RequestDelay time.Duration
// RequestDelayRandomize uses random interval between 0.5 * RequestDelay and 1.5 * RequestDelay
RequestDelayRandomize bool
// Disable logging by setting this true
LogDisabled bool
}