qinhanlei / tinylog

A tiny simple logger for golang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tinylog Build Status

Tiny simple naive

API

func Init(logdir string) {} // *.log files DIR path required
func SetLv(lv int)       {} // lv in (DEBUG = iota, INFO, WARN, ERROR, FATAL)
func SetFlag(flag int)   {} // see standard pkg log.LstdFlags
func Close()             {}
// utils
func Debug(format interface{}, v ...interface{}) {}
func Info(format interface{}, v ...interface{})  {}
func Warn(format interface{}, v ...interface{})  {}
func Error(format interface{}, v ...interface{}) {}
func Fatal(format interface{}, v ...interface{}) {}

Usage

go get -u github.com/qinhanlei/tinylog

package main

import log "github.com/qinhanlei/tinylog"

func main() {
	log.Debug("Hello Debug")
	log.Info("Hello Info")
	log.Warn("Hello Warn")
	log.Error("Hello Error")
	log.Fatal("Hello Fatal")
}

About

A tiny simple logger for golang

License:MIT License


Languages

Language:Go 100.0%