/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */

package ecload

import (
	"io"
	"log"
)

type Logger struct {
	Trace   *log.Logger
	Info    *log.Logger
	Warning *log.Logger
	Error   *log.Logger
}

func InitLogger(
	traceHandle io.Writer,
	infoHandle io.Writer,
	warningHandle io.Writer,
	errorHandle io.Writer) Logger {

	return Logger{
		Trace:   log.New(traceHandle, "TRACE: ", log.Ldate|log.Ltime),
		Info:    log.New(infoHandle, "INFO: ", log.Ldate|log.Ltime),
		Warning: log.New(warningHandle, "WARNING: ", log.Ldate|log.Ltime),
		Error:   log.New(errorHandle, "ERROR: ", log.Ldate|log.Ltime|log.Lshortfile),
	}
}
