Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/logPublic

📃 A lightweight, leveled logging package for Go.

License

NotificationsYou must be signed in to change notification settings

tevino/log

Repository files navigation

A lightweight, leveled logging package for Go.

Install

go get github.com/tevino/log

Features

  • Leveled logging and filtering
  • Colored output
  • Log with file name and line number

Example

import"github.com/tevino/log"log.SetOutputLevel(log.INFO)log.Debugf("Output level is %s.",log.OutputLevel())log.Info("Thus only this line is printed.")

Benchmark

BenchmarkLog15-4              300000          4391 ns/op        1202 B/op         16 allocs/opBenchmarkLogrus-4             500000          3444 ns/op        1715 B/op         24 allocs/opBenchmarkLoggo-4              500000          3275 ns/op         344 B/op         11 allocs/opBenchmarkGoLogging-4         1000000          1136 ns/op         601 B/op         10 allocs/opBenchmarkThisPackage-4       3000000           731 ns/op         214 B/op          2 allocs/opBenchmarkStdLog-4            2000000           571 ns/op         174 B/op          2 allocs/op

Acknowledgements

  • @kirk91: Provide APIs to make it possible for user to specify a custom caller offset.

About

📃 A lightweight, leveled logging package for Go.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp