MCPcopy
hub / github.com/NVIDIA/aistore / Set

Method Set

3rdparty/glog/glog.go:303–332  ·  view source on GitHub ↗

Syntax: -vmodule=recordio=2,file=1,gfs*=3

(value string)

Source from the content-addressed store, hash-verified

301
302// Syntax: -vmodule=recordio=2,file=1,gfs*=3
303func (*moduleSpec) Set(value string) error {
304 filter := make([]modulePat, 0, 2)
305 for _, pat := range strings.Split(value, ",") {
306 if pat == "" {
307 // Empty strings such as from a trailing comma can be ignored.
308 continue
309 }
310 patLev := strings.Split(pat, "=")
311 if len(patLev) != 2 || patLev[0] == "" || patLev[1] == "" {
312 return errVmoduleSyntax
313 }
314 pattern := patLev[0]
315 v, err := strconv.Atoi(patLev[1])
316 if err != nil {
317 return errors.New("syntax error: expect comma-separated list of filename=N")
318 }
319 if v < 0 {
320 return errors.New("negative value for vmodule level")
321 }
322 if v == 0 {
323 continue // Ignore. It's harmless but no point in paying the overhead.
324 }
325 // TODO: check syntax of filter?
326 filter = append(filter, modulePat{pattern: pattern, level: Level(v), literal: isLiteral(pattern)})
327 }
328 logging.mu.Lock()
329 defer logging.mu.Unlock()
330 logging.setVState(logging.verbosity, filter, true)
331 return nil
332}
333
334// isLiteral reports whether the pattern is a literal string, that is, has no metacharacters
335// that require filepath.Match to be called to match the pattern.

Callers

nothing calls this directly

Calls 6

LevelTypeAlias · 0.85
isLiteralFunction · 0.85
setVStateMethod · 0.80
NewMethod · 0.65
LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected