logging

package
v0.0.0-...-6f193cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// F file opened
	F *os.File

	// DefaultPrefix default prefix
	DefaultPrefix = ""
	// DefaultCallerDepth default caller depeth
	DefaultCallerDepth = 2
)

Functions

func CheckNotExist

func CheckNotExist(src string) bool

CheckNotExist check if the file exists

func CheckPermission

func CheckPermission(src string) bool

CheckPermission check if the file has permission

func Debug

func Debug(v ...interface{})

Debug output logs at debug level

func Error

func Error(v ...interface{})

Error output logs at error level

func Fatal

func Fatal(v ...interface{})

Fatal output logs at fatal level

func GetExt

func GetExt(fileName string) string

GetExt get the file ext

func GetSize

func GetSize(f multipart.File) (int, error)

GetSize get the file size

func Info

func Info(v ...interface{})

Info output logs at info level

func IsNotExistMkDir

func IsNotExistMkDir(src string) error

IsNotExistMkDir create a directory if it does not exist

func MkDir

func MkDir(src string) error

MkDir create a directory

func MustOpen

func MustOpen(fileName, filePath string) (*os.File, error)

MustOpen maximize trying to open the file

func Open

func Open(name string, flag int, perm os.FileMode) (*os.File, error)

Open a file according to a specific mode

func Setup

func Setup()

Setup initialize the log instance

func SetupTest

func SetupTest()

SetupTest generate a path to test output

func Warn

func Warn(v ...interface{})

Warn output logs at warn level

Types

type Level

type Level int

Level type used to receive the level of log

const (
	// DEBUG level
	DEBUG Level = iota
	// INFO info log
	INFO
	// WARNING warning log
	WARNING
	// ERROR error log
	ERROR
	// FATAL fata log
	FATAL
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL