Giter Club home page Giter Club logo

log4go's Introduction

log4go

Simple log library for Go language.

####Install

go get github.com/skoo87/log4go

####Usages Refer to examples

####Features

  • Output log to file, the file can be rotated by itself.
  • Output log to console.
  • Output log to remote server with syslog protocol.

####TODO

  1. syslog
  2. udp/tcp writer
  3. more of rules of log rotation
  4. custom the format of log

log4go's People

Contributors

skoowoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

log4go's Issues

report bug

package main

import (
	"time"

	log "github.com/skoo87/log4go"
)

func main() {
	w := log.NewFileWriter()
	w.SetPathPattern("error%Y%M%D%H.log")

	log.Register(w)
	log.SetLevel(log.DEBUG)

	defer log.Close()

	go func() {
		var name = "skoo"
		log.Debug("log4go by %s %s", name, time.Now())

	}()

	log.Close()
	time.Sleep(time.Second * 100)
}

if one goroutine is write log, another goroutine close log ,it goes panic .

Write into file delayed serious

With few exceptions, the log written into file is delayed seriouly.

e.g.

A part log is recorded at 13:00, and should be wrote at 13:00.
But this part log is written at 15:00, and the log is written at about 15:00.

Can not compile in windows

When i go get in windows, will get error:

github.com\skoo87\log4go\syslog_writer.go:18: undefined: syslog.Writer

Can make syslog_writer not build in windows?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.