code: func initHandlerFor(c *CompositeMultiHandler, output, basePath string, options *LogOptions) {
  	if options.Ctx != nil {
  		options.SetExtendedOptions(
  			"noColor", !options.Ctx.BoolDefault("log.colorize", true),
  			"smallDate", options.Ctx.BoolDefault("log.smallDate", true),
  			"maxSize", options.Ctx.IntDefault("log.maxsize", 1024*10),
  			"maxAge", options.Ctx.IntDefault("log.maxage", 14),
  			"maxBackups", options.Ctx.IntDefault("log.maxbackups", 14),
  			"compressBackups", !options.Ctx.BoolDefault("log.compressBackups", true),
  		)
  	}
  
  	output = strings.TrimSpace(output)
  	if funcHandler, found := LogFunctionMap[output]; found {
  		funcHandler(c, options)
  	} else {
  		switch output {
  		case "":
  			fallthrough
  		case "off":
  		// No handler, discard data
  		default:
  			// Write to file specified
  			if !filepath.IsAbs(output) {
  				output = filepath.Join(basePath, output)
  			}
  
  			if err := os.MkdirAll(filepath.Dir(output), 0755); err != nil {
  				log.Panic(err)
  			}
  
  			if strings.HasSuffix(output, "json") {
  				c.SetJsonFile(output, options)
  			} else {
  				// Override defaults for a terminal file
  				options.SetExtendedOptions("noColor", true)
  				options.SetExtendedOptions("smallDate", false)
  				c.SetTerminalFile(output, options)
  			}
  		}
  	}
  	return
  }
docs: // Returns a handler for the level using the output string
  // Accept formats for output string are
  // LogFunctionMap[value] callback function
  // `stdout` `stderr` `full/file/path/to/location/app.log` `full/file/path/to/location/app.json`