Archived
1
0
Fork 0
log4l provides a simple API to use logging features in Lua. Its design was based on log4j.
This repository has been archived on 2019-08-26. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Lua 99.3%
  • Shell 0.7%
Find a file
2019-08-26 13:46:46 +02:00
doc Prepare release 1.3.0 2013-03-05 02:16:04 -08:00
src added sugar 2019-08-26 13:46:31 +02:00
tests Update name EVERYWHERE ELSE 2017-05-04 12:03:53 -04:00
COPYRIGHT Update copryright year. 2013-03-05 02:16:04 -08:00
log4l-0.1-1.rockspec alpha rockspec 2017-04-16 12:13:40 -04:00
log4l-0.2-1.rockspec THERE I FIXED IT 2017-05-04 11:59:29 -04:00
log4l-0.2-2.rockspec Really should use a separate tag. 2017-05-04 12:08:49 -04:00
log4l-scm-0.rockspec Update rockspecs and file paths. 2017-05-04 12:08:16 -04:00
README It's now regular-installable. 2017-04-16 17:59:06 -04:00
run_tests.sh Email config from http://michaelthessel.com/mock-mail-setup-for-travis-ci/ 2017-04-15 11:00:22 -04:00
TODO added TODO 2019-08-26 13:46:46 +02:00

log4l
==========
https://mwchase.github.io/log4l/

log4l provides a simple API to use logging features in Lua.
Its design was based on log4j. log4l currently supports,
through the use of appenders, console, file, rolling file, email, socket and sql outputs.

Current version is 1.3.0. It was developed for Lua 5.1 & 5.2.

log4l is free software and uses the same license as Lua. It is part of the Kepler Project.

Please see docs at http://neopallium.github.com/lualogging/ for more details

Installation
============

Release 0.1
-------------

With LuaRocks:

    $ sudo luarocks install log4l

Latest Git revision
-------------------

With LuaRocks:

	$ sudo luarocks install https://github.com/mwchase/log4l/raw/log4l/log4l-scm-0.rockspec

With make:

	$ sudo make


Guide lines for improved logging performance
============================================

The changes that I have made allow more complex log message formatting to be done only when 
that log level is enabled.  This will decrease the impact of logging statement when their level 
is disabled.

* Use string.format() style formatting:

logger:info("Some message prefix: val1='%s', val2=%d", "some string value", 1234)

* For more complex log message formatting:

local function log_callback(val1, val2)
	-- Do some complex pre-processing of parameters, maybe dump a table to a string.
	return string.format("Some message prefix: val1='%s', val2=%d", val1, val2)
end
-- function 'log_callback' will only be called if the current log level is "DEBUG"
logger:debug(log_callback, "some string value", 1234)