Giter Club home page Giter Club logo

lualogging's Introduction

LuaLogging
==========
http://neopallium.github.com/lualogging/

LuaLogging provides a simple API to use logging features in Lua.
Its design was based on log4j. LuaLogging 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.

LuaLogging 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 1.3.0
-------------

With LuaRocks:

	$ sudo luarocks install lualogging

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

With LuaRocks:

	$ sudo luarocks install https://github.com/Neopallium/lualogging/raw/master/lualogging-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)


lualogging's People

Contributors

neopallium avatar

Watchers

James Cloos avatar David Thornley avatar

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.