Seelog is a native Go logging library that provides flexible asynchronous dispatching, filtering, and formatting.
Clone or download
Latest commit f561c5e Jan 30, 2017
Permalink
Failed to load latest commit information.
archive Avoid buffering logs in memory Oct 1, 2016
io/iotest Avoid buffering logs in memory Oct 1, 2016
LICENSE.txt License added Feb 12, 2012
README.markdown Update README.markdown Dec 16, 2015
behavior_adaptive_test.go Lowercase error strings. Jul 29, 2014
behavior_adaptivelogger.go Issue #95. Sep 30, 2015
behavior_asynclogger.go Protect access to the internal 'closed' flag of loggers May 26, 2015
behavior_asyncloop_test.go Lowercase error strings. Jul 29, 2014
behavior_asynclooplogger.go Issue #95. Sep 30, 2015
behavior_asynctimer_test.go Lowercase error strings. Jul 29, 2014
behavior_asynctimerlogger.go Issue #95. Sep 30, 2015
behavior_synclogger.go Issue #95. Sep 30, 2015
behavior_synclogger_test.go Lowercase error strings. Jul 29, 2014
cfg_config.go Logger clone helper May 19, 2016
cfg_errors.go Minor changes. Jul 30, 2014
cfg_logconfig.go Exported CfgParseParams. Dec 16, 2015
cfg_logconfig_test.go Issue #93. Sep 30, 2015
cfg_parser.go Support old rolling time receiver naming convention. (fixes #119) Jun 19, 2016
cfg_parser_test.go Support old rolling time receiver naming convention. (fixes #119) Jun 19, 2016
common_closer.go Fix tests by making file writers lazy initialized. Make minor changes Nov 15, 2012
common_constraints.go Issue #95. Sep 30, 2015
common_constraints_test.go Issue #95. Sep 30, 2015
common_context.go Cache caller info Dec 30, 2016
common_context_test.go Cache caller info Dec 30, 2016
common_exception.go Issue #95. Sep 30, 2015
common_exception_test.go Issue #95. Sep 30, 2015
common_flusher.go go fmt Aug 8, 2013
common_loglevel.go go fmt Aug 8, 2013
dispatch_custom.go Issue #95. Sep 30, 2015
dispatch_customdispatcher_test.go Issue #95. Sep 30, 2015
dispatch_dispatcher.go Issue #95. Sep 30, 2015
dispatch_filterdispatcher.go Issue #95. Sep 30, 2015
dispatch_filterdispatcher_test.go Issue #95. Sep 30, 2015
dispatch_splitdispatcher.go Issue #95. Sep 30, 2015
dispatch_splitdispatcher_test.go Issue #95. Sep 30, 2015
doc.go Issue #95. Sep 30, 2015
format.go add %r for windos Mar 25, 2016
format_test.go add %r for windos Mar 25, 2016
internals_baseerror.go go fmt Aug 8, 2013
internals_byteverifiers_test.go Lowercase error strings. Jul 29, 2014
internals_fsutils.go Avoid buffering logs in memory Oct 1, 2016
internals_xmlnode.go Minor changes. Jul 30, 2014
internals_xmlnode_test.go Fix XML syntax error with go1.6 Apr 5, 2016
log.go Issue #95. Sep 30, 2015
logger.go Issue #93. Sep 30, 2015
writers_bufferedwriter.go Issue #95. Sep 30, 2015
writers_bufferedwriter_test.go Remove racy test Jan 30, 2017
writers_connwriter.go Issue #95. Sep 30, 2015
writers_consolewriter.go Issue #95. Sep 30, 2015
writers_filewriter.go Issue #95. Sep 30, 2015
writers_filewriter_test.go resolve cihub/seelog#112 : Add gzip compression Apr 18, 2016
writers_formattedwriter.go Issue #95. Sep 30, 2015
writers_formattedwriter_test.go Issue #95. Sep 30, 2015
writers_rollingfilewriter.go Merge pull request #141 from lwithers/FileModeAppend Jan 30, 2017
writers_rollingfilewriter_test.go Support old rolling time receiver naming convention. (fixes #119) Jun 19, 2016
writers_smtpwriter.go Issue #95. Sep 30, 2015

README.markdown

Seelog

Seelog is a powerful and easy-to-learn logging framework that provides functionality for flexible dispatching, filtering, and formatting log messages. It is natively written in the Go programming language.

Build Status

Features

  • Xml configuring to be able to change logger parameters without recompilation
  • Changing configurations on the fly without app restart
  • Possibility to set different log configurations for different project files and functions
  • Adjustable message formatting
  • Simultaneous log output to multiple streams
  • Choosing logger priority strategy to minimize performance hit
  • Different output writers
    • Console writer
    • File writer
    • Buffered writer (Chunk writer)
    • Rolling log writer (Logging with rotation)
    • SMTP writer
    • Others... (See Wiki)
  • Log message wrappers (JSON, XML, etc.)
  • Global variables and functions for easy usage in standalone apps
  • Functions for flexible usage in libraries

Quick-start

package main

import log "github.com/cihub/seelog"

func main() {
    defer log.Flush()
    log.Info("Hello from Seelog!")
}

Installation

If you don't have the Go development environment installed, visit the Getting Started document and follow the instructions. Once you're ready, execute the following command:

go get -u github.com/cihub/seelog

IMPORTANT: If you are not using the latest release version of Go, check out this wiki page

Documentation

Seelog has github wiki pages, which contain detailed how-tos references: https://github.com/cihub/seelog/wiki

Examples

Seelog examples can be found here: seelog-examples

Issues

Feel free to push issues that could make Seelog better: https://github.com/cihub/seelog/issues

Changelog

  • v2.6 : Config using code and custom formatters
    • Configuration using code in addition to xml (All internal receiver/dispatcher/logger types are now exported).
    • Custom formatters. Check wiki
    • Bugfixes and internal improvements.
  • v2.5 : Interaction with other systems. Part 2: custom receivers
    • Finished custom receivers feature. Check wiki
    • Added 'LoggerFromCustomReceiver'
    • Added 'LoggerFromWriterWithMinLevelAndFormat'
    • Added 'LoggerFromCustomReceiver'
    • Added 'LoggerFromParamConfigAs...'
  • v2.4 : Interaction with other systems. Part 1: wrapping seelog
    • Added configurable caller stack skip logic
    • Added 'SetAdditionalStackDepth' to 'LoggerInterface'
  • v2.3 : Rethinking 'rolling' receiver
    • Reimplemented 'rolling' receiver
    • Added 'Max rolls' feature for 'rolling' receiver with type='date'
    • Fixed 'rolling' receiver issue: renaming on Windows
  • v2.2 : go1.0 compatibility point [go1.0 tag]
    • Fixed internal bugs
    • Added 'ANSI n [;k]' format identifier: %EscN
    • Made current release go1 compatible
  • v2.1 : Some new features
    • Rolling receiver archiving option.
    • Added format identifier: %Line
    • Smtp: added paths to PEM files directories
    • Added format identifier: %FuncShort
    • Warn, Error and Critical methods now return an error
  • v2.0 : Second major release. BREAKING CHANGES.
    • Support of binaries with stripped symbols
    • Added log strategy: adaptive
    • Critical message now forces Flush()
    • Added predefined formats: xml-debug, xml-debug-short, xml, xml-short, json-debug, json-debug-short, json, json-short, debug, debug-short, fast
    • Added receiver: conn (network connection writer)
    • BREAKING CHANGE: added Tracef, Debugf, Infof, etc. to satisfy the print/printf principle
    • Bug fixes
  • v1.0 : Initial release. Features:
    • Xml config
    • Changing configurations on the fly without app restart
    • Contraints and exceptions
    • Formatting
    • Log strategies: sync, async loop, async timer
    • Receivers: buffered, console, file, rolling, smtp