code: func InitLogger(cfg *LogConfig) error {
  	log.SetLevel(stringToLogLevel(cfg.Level))
  	log.AddHook(&contextHook{})
  
  	if cfg.Format == "" {
  		cfg.Format = DefaultLogFormat
  	}
  	formatter := stringToLogFormatter(cfg.Format, cfg.DisableTimestamp)
  	log.SetFormatter(formatter)
  
  	if len(cfg.File.Filename) != 0 {
  		if err := initFileLog(&cfg.File, nil); err != nil {
  			return errors.Trace(err)
  		}
  	}
  
  	if len(cfg.SlowQueryFile) != 0 {
  		SlowQueryLogger = log.New()
  		tmp := cfg.File
  		tmp.Filename = cfg.SlowQueryFile
  		if err := initFileLog(&tmp, SlowQueryLogger); err != nil {
  			return errors.Trace(err)
  		}
  		SlowQueryLogger.Formatter = &slowLogFormatter{}
  	}
  
  	return nil
  }
docs: // InitLogger initializes PD's logger.