code: func CustomWriterLevel(level logrus.Level, maxScanTokenSize int) *io.PipeWriter {
  	reader, writer := io.Pipe()
  
  	var printFunc func(args ...interface{})
  
  	switch level {
  	case logrus.DebugLevel:
  		printFunc = Debug
  	case logrus.InfoLevel:
  		printFunc = Info
  	case logrus.WarnLevel:
  		printFunc = Warn
  	case logrus.ErrorLevel:
  		printFunc = Error
  	case logrus.FatalLevel:
  		printFunc = Fatal
  	case logrus.PanicLevel:
  		printFunc = Panic
  	default:
  		printFunc = mainLogger.Print
  	}
  
  	go writerScanner(reader, maxScanTokenSize, printFunc)
  	runtime.SetFinalizer(writer, writerFinalizer)
  
  	return writer
  }
docs: // CustomWriterLevel logs writer for a specific level. (with a custom scanner buffer size.)
  // adapted from github.com/Sirupsen/logrus/writer.go