GithubHelp home page GithubHelp logo

poolqa / log Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 60 KB

打包go-logging加上rotate、conf配置,方便調用

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%
golang logging go-logging rotate-file

log's Introduction

log

How to use

  1. use Default
  log.Default() // you can see the default setting at config.go
  log.Info("info")
  1. use file path
  log.InitByConfigFile("./log.conf") // you can see the example at example 
  log.Info("info")
  1. use json
  log.InitByConfigJson(string(log.GetDefaultLogConfig()))
  log.Info("info")

benchstat

system: windows 7 x64 sp1

cpu(s): 8

model name: Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz

memery: 8G

TextPositiveWithConsole

test ops ns/op bytes/op allocs/op
BenchmarkLogTextPositive 30000 46702 ns/op 4016 B/op 78 allocs/op
BenchmarkLogTextPositive-2 50000 24721 ns/op 4016 B/op 78 allocs/op
BenchmarkLogTextPositive-4 100000 15950 ns/op 4017 B/op 78 allocs/op
BenchmarkLogTextPositive-8 200000 11295 ns/op 4019 B/op 78 allocs/op

TextPositiveWithoutConsole

test ops ns/op bytes/op allocs/op
BenchmarkLogTextPositive 100000 18831 ns/op 2480 B/op 48 allocs/op
BenchmarkLogTextPositive-2 200000 10010 ns/op 2480 B/op 48 allocs/op
BenchmarkLogTextPositive-4 200000 6840 ns/op 2481 B/op 48 allocs/op
BenchmarkLogTextPositive-8 200000 7905 ns/op 2482 B/op 48 allocs/op

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.