code: func (fw *Framework) SetupLogging(debug bool) (err error) {
  	fw.log = log.New()
  
  	fw.log.Out = os.Stdout
  
  	if fw.Config.LogFile != "" {
  		fw.log.Formatter = &log.JSONFormatter{}
  
  		file, err := os.OpenFile(fw.Config.LogFile, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0666)
  		if err != nil {
  			return fmt.Errorf("Could not set up logging: %s", err)
  		}
  
  		fw.log.Out = file
  	}
  
  	switch fw.Config.LogLevel {
  	case "debug":
  		fw.log.SetLevel(log.DebugLevel)
  	case "info":
  		fw.log.SetLevel(log.InfoLevel)
  	case "warn":
  		fw.log.SetLevel(log.WarnLevel)
  	case "error":
  		fw.log.SetLevel(log.ErrorLevel)
  	case "fatal":
  		fw.log.SetLevel(log.FatalLevel)
  	default:
  		fw.log.SetLevel(log.WarnLevel)
  	}
  
  	if debug {
  		fw.log.SetLevel(log.DebugLevel)
  	}
  
  	log.SetFormatter(fw.log.Formatter)
  	log.SetLevel(fw.log.Level)
  	log.SetOutput(fw.log.Out)
  
  	return
  }
docs: // SetupLogging configures logging based on choria config directives
  // currently only file and console behaviours are supported