diff --git a/CMakeLists.txt b/CMakeLists.txt index 20a1aed..447fc6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,9 @@ include ( lua ) install_lua_module ( log lua/log.lua ) install_lua_module ( log.formatter.concat lua/log/formatter/concat.lua ) +install_lua_module ( log.formatter.default lua/log/formatter/default.lua ) install_lua_module ( log.formatter.format lua/log/formatter/format.lua ) +install_lua_module ( log.formatter.pformat lua/log/formatter/pformat.lua ) install_lua_module ( log.formatter.mix lua/log/formatter/mix.lua ) install_lua_module ( log.logformat.default lua/log/logformat/default.lua ) install_lua_module ( log.logformat.proxy lua/log/logformat/proxy.lua ) @@ -40,6 +42,7 @@ install_lua_module ( log.writer.net.zmq._private.impl lua/log/writer/net/zmq/_ install_lua_module ( log.writer.net.zmq.pub lua/log/writer/net/zmq/pub.lua ) install_lua_module ( log.writer.net.zmq.push lua/log/writer/net/zmq/push.lua ) install_lua_module ( log.writer.net.zmq.srv.pub lua/log/writer/net/zmq/srv/pub.lua ) +install_lua_module ( log.writer.prefix lua/log/writer/prefix.lua ) install_lua_module ( log.writer.stderr lua/log/writer/stderr.lua ) install_lua_module ( log.writer.stdout lua/log/writer/stdout.lua ) diff --git a/dist.info b/dist.info index 26885e1..4a749d8 100644 --- a/dist.info +++ b/dist.info @@ -1,5 +1,5 @@ name = "lua-log" -version = "0.1.4" +version = "0.1.6" desc = "Asynchronous logging library" author = "Alexey Melnichuk" diff --git a/lua/log.lua b/lua/log.lua index 22af7c8..bb93f4b 100644 --- a/lua/log.lua +++ b/lua/log.lua @@ -3,7 +3,7 @@ -- local _COPYRIGHT = "Copyright (C) 2013-2016 Alexey Melnichuk"; -local _VERSION = "0.1.6-dev" +local _VERSION = "0.1.6" local table = require "table" local string = require "string" @@ -95,6 +95,8 @@ function Log.new(max_lvl, writer, formatter, logformat) function logger.format() return logformat end + function logger.lvl() return max_lvl end + function logger.set_writer(value) assert(value) writer, value = value, writer @@ -102,11 +104,13 @@ function Log.new(max_lvl, writer, formatter, logformat) end function logger.set_formatter(value) + assert(value) formatter, value = value, formatter return value end function logger.set_format(value) + assert(value) logformat, value = value, logformat return value end @@ -134,8 +138,6 @@ function Log.new(max_lvl, writer, formatter, logformat) return true end - function logger.lvl() return max_lvl end - assert(logger.set_lvl(max_lvl)) loggers_list[logger] = true; diff --git a/rockspecs/lua-log-0.1.6-1.rockspec b/rockspecs/lua-log-0.1.6-1.rockspec new file mode 100644 index 0000000..5404c06 --- /dev/null +++ b/rockspecs/lua-log-0.1.6-1.rockspec @@ -0,0 +1,78 @@ +package = "lua-log" +version = "0.1.6-1" +source = { + url = "https://github.com/moteus/lua-log/archive/v0.1.6.zip", + dir = "lua-log-0.1.6", +} + +description = { + summary = "Asynchronous logging library", + detailed = [[ + ]], + homepage = "https://github.com/moteus/lua-log", + license = "MIT/X11", +} + +dependencies = { + "lua >= 5.1, < 5.4", + "date >= 2.0", + -- "lpeg >= 0.10.0", + -- "llthread >= 1.2", + -- "luasocket >= 2.0.1", + -- "lzmq >= 0.4.2", + -- "sendmail >= 0.1.0", + -- "lanes >= 3.5", + -- "ansicolors >= 1.0", +} + +build = { + type = "builtin", + copy_directories = { + "examples", + "utils", + "doc", + }, + modules = { + ["log" ] = "lua/log.lua", + ["log.formatter.concat" ] = "lua/log/formatter/concat.lua", + ["log.formatter.default" ] = "lua/log/formatter/default.lua", + ["log.formatter.format" ] = "lua/log/formatter/format.lua", + ["log.formatter.pformat" ] = "lua/log/formatter/pformat.lua", + ["log.formatter.mix" ] = "lua/log/formatter/mix.lua", + ["log.logformat.default" ] = "lua/log/logformat/default.lua", + ["log.logformat.proxy" ] = "lua/log/logformat/proxy.lua", + ["log.logformat.proxy.pack" ] = "lua/log/logformat/proxy/pack.lua", + ["log.logformat.syslog" ] = "lua/log/logformat/syslog.lua", + ["log.writer.async._private.server" ] = "lua/log/writer/async/_private/server.lua", + ["log.writer.async.lane" ] = "lua/log/writer/async/lane.lua", + ["log.writer.async.server.lane"] = "lua/log/writer/async/server/lane.lua", + ["log.writer.async.server.udp" ] = "lua/log/writer/async/server/udp.lua", + ["log.writer.async.server.zmq" ] = "lua/log/writer/async/server/zmq.lua", + ["log.writer.async.udp" ] = "lua/log/writer/async/udp.lua", + ["log.writer.async.zmq" ] = "lua/log/writer/async/zmq.lua", + ["log.writer.console" ] = "lua/log/writer/console.lua", + ["log.writer.console.color" ] = "lua/log/writer/console/color.lua", + ["log.writer.file" ] = "lua/log/writer/file.lua", + ["log.writer.file.by_day" ] = "lua/log/writer/file/by_day.lua", + ["log.writer.file.private.impl"] = "lua/log/writer/file/private/impl.lua", + ["log.writer.file.roll" ] = "lua/log/writer/file/roll.lua", + ["log.writer.filter" ] = "lua/log/writer/filter.lua", + ["log.writer.filter.lvl.eq" ] = "lua/log/writer/filter/lvl/eq.lua", + ["log.writer.filter.lvl.le" ] = "lua/log/writer/filter/lvl/le.lua", + ["log.writer.format" ] = "lua/log/writer/format.lua", + ["log.writer.list" ] = "lua/log/writer/list.lua", + ["log.writer.net.server.udp" ] = "lua/log/writer/net/server/udp.lua", + ["log.writer.net.server.zmq" ] = "lua/log/writer/net/server/zmq.lua", + ["log.writer.net.smtp" ] = "lua/log/writer/net/smtp.lua", + ["log.writer.net.udp" ] = "lua/log/writer/net/udp.lua", + ["log.writer.net.zmq" ] = "lua/log/writer/net/zmq.lua", + ["log.writer.net.zmq._private.compat" ] = "lua/log/writer/net/zmq/_private/compat.lua", + ["log.writer.net.zmq._private.impl" ] = "lua/log/writer/net/zmq/_private/impl.lua", + ["log.writer.net.zmq.pub" ] = "lua/log/writer/net/zmq/pub.lua", + ["log.writer.net.zmq.push" ] = "lua/log/writer/net/zmq/push.lua", + ["log.writer.net.zmq.srv.pub" ] = "lua/log/writer/net/zmq/srv/pub.lua", + ["log.writer.prefix" ] = "lua/log/writer/prefix.lua", + ["log.writer.stderr" ] = "lua/log/writer/stderr.lua", + ["log.writer.stdout" ] = "lua/log/writer/stdout.lua", + } +} diff --git a/rockspecs/lua-log-scm-0.rockspec b/rockspecs/lua-log-scm-0.rockspec index 9e1223b..8b18f92 100644 --- a/rockspecs/lua-log-scm-0.rockspec +++ b/rockspecs/lua-log-scm-0.rockspec @@ -30,6 +30,7 @@ build = { copy_directories = { "examples", "utils", + "doc", }, modules = { ["log" ] = "lua/log.lua", @@ -75,6 +76,3 @@ build = { ["log.writer.stdout" ] = "lua/log/writer/stdout.lua", } } - - -