diff options
Diffstat (limited to 'utils.lua')
-rw-r--r-- | utils.lua | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -146,4 +146,20 @@ function M.notify_singleton(wsp, id, args) wsp.notify_tbl[id] = naughty.notify(args) end +function M.log(component, msg, ...) + local prefix = string.format('[awesome/%s] ', component) + local str = string.format(msg, ...) + + print(prefix .. str) + + return prefix, str +end + +function M.warn(component, msg, ...) + local prefix, str = M.log(component, msg, ...) + naughty.notify({ preset = naughty.config.presets.critical, + title = prefix, + text = str }) +end + return M |