diff --git a/rc.lua b/rc.lua
index 6d2cd75..4ce64b8 100644
--- a/rc.lua
+++ b/rc.lua
@@ -13,9 +13,8 @@ layouts = require('layouts')
-- {{{ Logging
log = require("simplelog")
-log.add_logger(log.loggers.stdio, log.level.debug)
-log.add_logger(log.loggers.naughty, log.level.warn)
-
+log.add_logger(log.loggers.stdio, log.level.DEBUG)
+log.add_logger(log.loggers.naughty, log.level.WARNING)
-- }}}
-- {{{ Tags
diff --git a/simplelog.lua b/simplelog.lua
index d88c44f..a3f2ef7 100644
--- a/simplelog.lua
+++ b/simplelog.lua
@@ -1,4 +1,5 @@
local naughty = require("naughty")
+local awful = require("awful")
local simplelog = { loggers = {}, mt = {}}
@@ -12,13 +13,12 @@ for key, value in pairs(defaults) do
settings[key] = value
end
-local level = {
+simplelog.level = {
ERROR = 3,
WARNING = 2,
NORMAL = 1,
DEBUG = 0
}
-simplelog.level = level
local function loglv(msg, level)
for _,logger in ipairs(settings.loggers) do
@@ -54,18 +54,24 @@ function simplelog.add_logger(logger, level)
end
function simplelog.loggers.naughty(msg, severity)
- if severity == level.WARNING then
+ if severity == simplelog.level.WARNING then
msg = "".. msg .. ""
- elseif severity == level.ERROR then
+ elseif severity == simplelog.level.ERROR then
msg = "".. msg .. ""
end
naughty.notify({ text = msg })
end
+function simplelog.spawn(command)
+ simplelog.dbg("Executing: " .. command)
+ awful.util.spawn(command)
+end
+
function simplelog.loggers.stdio(msg, severity)
print(msg)
end
+
simplelog.mt.__call = function(t,message) simplelog.log(message) end
return setmetatable(simplelog, simplelog.mt)