github.com/Cloud-Foundations/Dominator@v0.3.4/lib/log/filelogger/api.go (about)

     1  package filelogger
     2  
     3  import (
     4  	"bufio"
     5  	"os"
     6  
     7  	"github.com/Cloud-Foundations/Dominator/lib/log/debuglogger"
     8  )
     9  
    10  type Logger struct {
    11  	*debuglogger.Logger
    12  	file   *os.File
    13  	writer *bufio.Writer
    14  }
    15  
    16  type Options struct {
    17  	Flags      int
    18  	DebugLevel int16 // Supported range: -1 to 32767.
    19  }
    20  
    21  // New will create a *Logger with the specified filename and options.
    22  func New(filename string, options Options) (*Logger, error) {
    23  	return newLogger(filename, options)
    24  }
    25  
    26  func (l *Logger) Close() error {
    27  	return l.close()
    28  }
    29  
    30  func (l *Logger) Flush() error {
    31  	return l.writer.Flush()
    32  }