code: func InitLogger(purpose LoggingPurpose, level log.Level, verbose ...bool) {
  	log.StandardLogger().SetHooks(make(log.LevelHooks))
  	log.SetLevel(level)
  
  	switch purpose {
  	case LoggingForCLI:
  		// If debug logging was asked for on the CLI, then write logs to stderr.
  		// Otherwise discard all logs.
  		if level == log.DebugLevel {
  			log.SetFormatter(&trace.TextFormatter{
  				DisableTimestamp: true,
  				EnableColors:     trace.IsTerminal(os.Stderr),
  			})
  			log.SetOutput(os.Stderr)
  		} else {
  			log.SetOutput(ioutil.Discard)
  		}
  	case LoggingForDaemon:
  		log.SetFormatter(&trace.TextFormatter{
  			DisableTimestamp: true,
  			EnableColors:     trace.IsTerminal(os.Stderr),
  		})
  		log.SetOutput(os.Stderr)
  	case LoggingForTests:
  		log.SetFormatter(&trace.TextFormatter{
  			DisableTimestamp: true,
  			EnableColors:     true,
  		})
  		log.SetLevel(level)
  		log.SetOutput(os.Stderr)
  		if len(verbose) != 0 && verbose[0] {
  			return
  		}
  		val, _ := strconv.ParseBool(os.Getenv(teleport.VerboseLogsEnvVar))
  		if val {
  			return
  		}
  		val, _ = strconv.ParseBool(os.Getenv(teleport.DebugEnvVar))
  		if val {
  			return
  		}
  		log.SetLevel(log.WarnLevel)
  		log.SetOutput(ioutil.Discard)
  	}
  }
docs: // InitLogger configures the global logger for a given purpose / verbosity level