// SetLogLevelRegex sets all loggers to level `l` that match expression `e`.
// An error is returned if `e` fails to compile.
SetLogLevelRegex sets all loggers to level `l` that match expression `e`.
An error is returned if `e` fails to compile.
// SetLogLevelRegex sets all loggers to level ` l ` that match expression ` e ` . // An error is returned if ` e ` fails to compile .
func SetLogLevelRegex(e, l string) error {
	lvl, err := LevelFromString(l)
	if err != nil {
		return err
	}
	rem, err := regexp.Compile(e)
	if err != nil {
		return err
	}
	loggerMutex.Lock()
	defer loggerMutex.Unlock()
	for name := range loggers {
		if rem.MatchString(name) {
			levels[name].SetLevel(zapcore.Level(lvl))
		}
	}
	return nil
}
func SetLogLevelRegex ( e , l string ) error { lvl , err := LevelFromString ( l ) if err != nil { return err } rem , err := regexp . Compile ( e ) if err != nil { return err } loggerMutex . Lock ( ) defer loggerMutex . Unlock ( ) for name := range loggers { if rem . MatchString ( name ) { levels [ name ] . SetLevel ( zapcore . Level ( lvl ) ) } } return nil }
SetLogLevelRegex sets all loggers to level `l` that match expression `e`.
SetLogLevelRegex sets all loggers to level ` l ` that match expression ` e ` .