// NewLogger() launches a goroutine to log and returns logger.
// Logger has a channel to interact with the goroutine.
NewLogger() launches a goroutine to log and returns logger.
Logger has a channel to interact with the goroutine.
// NewLogger () launches a goroutine to log and returns logger . // Logger has a channel to interact with the goroutine .
func NewLogger(config Config) *Logger {
	config.applyDefaultValues()
	logger := &Logger{
		config:   config,
		postCh:   make(chan message, config.ChannelLength),
		ticker:   time.NewTicker(config.BufferingTimeout),
		logError: true,
	}
	go logger.loop()
	defer logger.sendMessage()
	return logger
}
func NewLogger ( config Config ) * Logger { config . applyDefaultValues ( ) logger := & Logger { config : config , postCh : make ( chan message , config . ChannelLength ) , ticker : time . NewTicker ( config . BufferingTimeout ) , logError : true , } go logger . loop ( ) defer logger . sendMessage ( ) return logger }
NewLogger() launches a goroutine to log and returns logger.
NewLogger () launches a goroutine to log and returns logger .