pax_global_header 0000666 0000000 0000000 00000000064 12115342744 0014515 g ustar 00root root 0000000 0000000 52 comment=c85130120406b9641e96ab05f782dde819fbd102
lua-logging-1.3.0/ 0000775 0000000 0000000 00000000000 12115342744 0013723 5 ustar 00root root 0000000 0000000 lua-logging-1.3.0/COPYRIGHT 0000664 0000000 0000000 00000002051 12115342744 0015214 0 ustar 00root root 0000000 0000000 Copyright (c) 2004-2013 Kepler Project.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
lua-logging-1.3.0/Makefile 0000664 0000000 0000000 00000000642 12115342744 0015365 0 ustar 00root root 0000000 0000000 # Default prefix
PREFIX = /usr/local
# System's lua directory (where Lua libraries are installed)
LUA_DIR= $(PREFIX)/share/lua/5.1
LUAS= src/logging/console.lua src/logging/email.lua src/logging/file.lua src/logging/rolling_file.lua src/logging/socket.lua src/logging/sql.lua
ROOT_LUAS= src/logging.lua
build clean:
install:
mkdir -p $(LUA_DIR)/logging
cp $(LUAS) $(LUA_DIR)/logging
cp $(ROOT_LUAS) $(LUA_DIR)
lua-logging-1.3.0/Makefile.win 0000664 0000000 0000000 00000000573 12115342744 0016164 0 ustar 00root root 0000000 0000000
LUA_DIR= c:\lua5.1\lua
LUAS= src\logging\console.lua src\logging\email.lua src\logging\file.lua src\logging\rolling_file.lua src\logging\socket.lua src\logging\sql.lua
ROOT_LUAS= src\logging.lua
build clean:
install:
IF NOT EXIST $(LUA_DIR)\logging mkdir $(LUA_DIR)\logging
FOR %i IN ($(LUAS)) DO copy %i $(LUA_DIR)\logging
FOR %i IN ($(ROOT_LUAS)) DO copy %i $(LUA_DIR)
lua-logging-1.3.0/README 0000664 0000000 0000000 00000003126 12115342744 0014605 0 ustar 00root root 0000000 0000000 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)
lua-logging-1.3.0/doc/ 0000775 0000000 0000000 00000000000 12115342744 0014470 5 ustar 00root root 0000000 0000000 lua-logging-1.3.0/doc/br/ 0000775 0000000 0000000 00000000000 12115342744 0015073 5 ustar 00root root 0000000 0000000 lua-logging-1.3.0/doc/br/console.tpl 0000664 0000000 0000000 00000001377 12115342744 0017266 0 ustar 00root root 0000000 0000000
Appender de console
O console é o appender mais simples. Ele apenas escreve as mensagens de
log em io.stdout
.
function logging.console([logPattern])
logPattern
:
É possível especificar um
padrão para controlar o modo como a mensagem é escrita.
O valor padrão é "%date %level %message\n"
.
Exemplos
require"logging.console"
local logger = logging.console()
logger:info("teste de logging.console")
logger:debug("depurando...")
logger:error("erro!")
lua-logging-1.3.0/doc/br/email.tpl 0000664 0000000 0000000 00000004701 12115342744 0016705 0 ustar 00root root 0000000 0000000
Appender de email
Este appender pode ser usado para enviar solicitações de log por email.
Uma mensagem de email é enviada para cada solicitação de log.
function logging.email {
from = string,
rcpt = string or string-table,
[user = string,]
[password = string,]
[server = string,]
[port = number,]
[domain = string,]
[headers = table,]
[logPattern = string,]
}
from
:
O remetente da mensagem de email.
rcpt
:
O destinatário da mensagem de email. Uma string ou uma tabela Lua numérica com várias strings.
user
:
O usuário para autenticação.
password
:
A senha para autenticação.
server
:
O servidor ao qual conectar.
O padrão é "localhost"
.
port
:
A porta à qual conectar.
O padrão é 25
.
domain
:
O nome do domínio usado para acessar o servidor.
Usa como padrão o nome do host do computador local.
headers.to
:
O destinatário da mensagem, como uma
descrição extensa.
headers.from
:
O remetente da mensagem, como uma
descrição extensa.
headers.subject
:
O assunto da mensagem enviada. Pode conter
padrões como o parâmetro logPattern
.
logPattern
:
É possível especificar um
padrão para controlar o modo como a mensagem é gravada.
O valor padrão é "%date %level %message\n"
.
Exemplo
require"logging.email"
local logger = logging.email {
rcpt = "mail@host.com",
from = "mail@host.com",
headers = {
subject = "[%level] logging.email test",
},
}
logger:info("teste de logging.sql")
logger:debug("depurando...")
logger:error("erro!")
lua-logging-1.3.0/doc/br/file.tpl 0000664 0000000 0000000 00000003532 12115342744 0016536 0 ustar 00root root 0000000 0000000
Appender de arquivo
O appender de arquivo pode ser usado para escrever mensagens de log em
um arquivo. Ele usa rotinas de E/S de Lua para realizar essa tarefa.
function logging.file(filename, [datePattern], [logPattern])
filename
:
O nome do arquivo de destino da gravação.
A cada chamada para registrar uma mensagem, o arquivo é aberto para
anexação e fechado imediatamente.
Se não for
possível abrir o arquivo para anexação, a solicitação
de log retorna nil e uma mensagem de erro.
datePattern
:
Trata-se de um parâmetro opcional
que pode ser usado para especificar um padrão de data que será
passado para a função
os.date
de modo a compor o nome do arquivo.
Isso é útil para criar
arquivos de log diários ou mensais. Se o usuário quiser criar um
arquivo de log por dia, deve especificar um padrão "%A-%m-%d"
e um nome de arquivo como "temp%s.log"
.
logPattern
:
É possível especificar um
padrão para controlar o modo como a mensagem é gravada.
O valor padrão é "%date %level %message\n"
.
Exemplo
require"logging.file"
local logger = logging.file("teste%s.log", "%A-%m-%d")
logger:info("teste de logging.file")
logger:debug("depurando...")
logger:error("erro!")
lua-logging-1.3.0/doc/br/footer.tpl 0000664 0000000 0000000 00000000450 12115342744 0017111 0 ustar 00root root 0000000 0000000
