func NewLogger(writer io.Writer, debug bool, json bool, serverName string) (*Logger, error) {
	hostname, err := os.Hostname()
	if err != nil {
		return nil, err
	}
	user, err := user.Current()
	userName := ""
	if err == nil {
		userName = user.Username
	}
	return &Logger{
		mutex:       sync.Mutex{},
		writer:      writer,
		debug:       debug,
		json:        json,
		processName: os.Args[0],
		pid:         strconv.Itoa(os.Getpid()),
		serverName:  serverName,
		host:        hostname,
		userName:    userName,
	}, nil
}
NewLogger creates a new logger
package logger
import (
	"encoding/json"
	"fmt"
	"io"
	"os"
	"os/user"
	"strconv"
	"sync"
	"time"
)
const timestampFormat string = "2006-01-02T15:04:05.000Z07:00"
const debugLevel string = "DEBUG"
const infoLevel string = "INFO"
const errorLevel string = "ERROR"
type Logger struct {
	mutex       sync.Mutex
	writer      io.Writer
	debug       bool
	json        bool
	processName string
	pid         string
	serverName  string
	host        string
	userName    string
}