code: func (cfg Configuration) BuildLogger() (Logger, error) {
  	writer := io.Writer(os.Stdout)
  
  	if cfg.File != "" {
  		fd, err := os.OpenFile(cfg.File, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
  		if err != nil {
  			return nil, err
  		}
  
  		writer = io.MultiWriter(writer, fd)
  	}
  
  	logger := NewLogger(writer)
  
  	if len(cfg.Level) != 0 {
  		level, err := ParseLevel(cfg.Level)
  		if err != nil {
  			return nil, err
  		}
  
  		logger = NewLevelLogger(logger, level)
  	}
  
  	if len(cfg.Fields) != 0 {
  		var fields []Field
  		for k, v := range cfg.Fields {
  			fields = append(fields, NewField(k, v))
  		}
  		logger = logger.WithFields(fields...)
  	}
  
  	return logger, nil
  }
docs: // BuildLogger builds a new Logger based on the configuration.