code: func NewLogFile(logPath string, capacity int64, maxFiles int, compress bool, marshaller logger.MarshalFunc, decodeFunc makeDecoderFunc, perms os.FileMode, getTailReader GetTailReaderFunc) (*LogFile, error) {
  	log, err := os.OpenFile(logPath, os.O_WRONLY|os.O_APPEND|os.O_CREATE, perms)
  	if err != nil {
  		return nil, err
  	}
  
  	size, err := log.Seek(0, os.SEEK_END)
  	if err != nil {
  		return nil, err
  	}
  
  	return &LogFile{
  		f:               log,
  		capacity:        capacity,
  		currentSize:     size,
  		maxFiles:        maxFiles,
  		compress:        compress,
  		filesRefCounter: refCounter{counter: make(map[string]int)},
  		notifyRotate:    pubsub.NewPublisher(0, 1),
  		marshal:         marshaller,
  		createDecoder:   decodeFunc,
  		perms:           perms,
  		getTailReader:   getTailReader,
  	}, nil
  }
docs: // NewLogFile creates new LogFile