github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/log/options.go (about)

     1  package log
     2  
     3  type Option interface {
     4  	applyHolderOption(l *wrapper)
     5  }
     6  
     7  type coloringSimpleOption bool
     8  
     9  func (coloring coloringSimpleOption) applySimpleOption(l *defaultLogger) {
    10  	l.coloring = bool(coloring)
    11  }
    12  
    13  func WithColoring() simpleLoggerOption {
    14  	return coloringSimpleOption(true)
    15  }
    16  
    17  type minLevelSimpleOption Level
    18  
    19  func (minLevel minLevelSimpleOption) applySimpleOption(l *defaultLogger) {
    20  	l.minLevel = Level(minLevel)
    21  }
    22  
    23  func WithMinLevel(level Level) simpleLoggerOption {
    24  	return minLevelSimpleOption(level)
    25  }
    26  
    27  type logQueryOption bool
    28  
    29  func (logQuery logQueryOption) applySimpleOption(l *defaultLogger) {
    30  	l.logQuery = bool(logQuery)
    31  }
    32  
    33  func (logQuery logQueryOption) applyHolderOption(l *wrapper) {
    34  	l.logQuery = bool(logQuery)
    35  }
    36  
    37  func WithLogQuery() logQueryOption {
    38  	return true
    39  }