go-ego / gse

Go efficient multilingual NLP and text segmentation; support English, Chinese, Japanese and others.
Apache License 2.0
2.57k stars 215 forks source link

开启了SkipLog,仍然打印日志 #171

Closed kakuilan closed 1 year ago

kakuilan commented 1 year ago
  1. Please speak English (English only), this is the language everybody of us can speak and write.
  2. Please take a moment to search that an issue doesn't already exist.
  3. Please ask questions or config/deploy problems on our Gitter channel: https://gitter.im/go-ego/ego
  4. Please give all relevant information below for bug reports, incomplete details will be handled as an invalid report.

You MUST delete the content above including this line before posting, otherwise your issue will be invalid.

var tagExtracter *idf.TagExtracter
var onceSeg sync.Once
var err error
onceSeg.Do(func() {
    seg := gse.Segmenter{
        SkipLog: true,
    }
    err = seg.LoadDict()
    if err == nil {
        var te idf.TagExtracter
        te.WithGse(seg)
        err = te.LoadIdf()
        if err == nil {
            tagExtracter = &te
        }
    }
})

Description

开启了SkipLog,但仍然打印了加载字典文件的日志 2023/05/28 11:29:08 Dict files path: [/var/www/api/vendor/github.com/go-ego/gse/data/dict/zh/idf.txt] 2023/05/28 11:29:08 Load the gse dictionary: "/var/www/api/vendor/github.com/go-ego/gse/data/dict/zh/idf.txt" 2023/05/28 11:29:10 Gse dictionary loaded finished.

...

期望开启了SkipLog,不打印任何日志