func TestLogger_Trace(t *testing.T) {
	readOutput()
	logger.Trace("trace")
	t.Log(buf.String())
}
func TestLogger_LogToFile(t *testing.T) {
var now = time.Now().Format("2006.01.02 15:04:05")
log := fmt.Sprintf("[%s] ERROR: test error", now)
path := "./log/error.log"
logger.LogToFile(path, teles.Error, "test error")
result, err := os.Stat(path)
assert.NotNil(t, result)
assert.NoError(t, err)
assert.Equal(t, os.IsNotExist(err), false)
assert.Equal(t, result.IsDir(), false)
lastLine := readLastLine(path)
fmt.Println("last:", lastLine)
fmt.Println("log:", log)
assert.Equal(t, lastLine, log)
}
package teles_test
import (
	"bytes"
	"log"
	"os"
	"reflect"
	"testing"
	"github.com/4FR4KO-POVELECKO/teles"
	"github.com/stretchr/testify/assert"
)
func TestLogger_New(t *testing.T) {
	logger := teles.New()
	assert.Equal(t, reflect.TypeOf(logger), reflect.TypeOf(&teles.Logger{}))
}
var buf bytes.Buffer
var logger = teles.New()
func readOutput() {
	log.SetOutput(&buf)
	defer func() {
		log.SetOutput(os.Stderr)
	}()
}
func TestLogger_NewBot(t *testing.T) {}
func TestLogger_NewDir(t *testing.T) {
	path := "./log"
	levels := []teles.Level{
		teles.Error,
		teles.Fatal,
	}
	err := logger.NewDir(path, levels)
	assert.NoError(t, err)
	assert.Equal(t, logger.DirPath, path)
	assert.Equal(t, logger.DirLevels, levels)
}