local n = require("naughty").notification local gdebug = require "gears.debug" ---@class QuarrelDebug local M = {} --- Send a notification with the specified message ---@param message any function M.debug(message) if type(message) == "table" then gdebug.dump(message, "data", 8) n { message = "Dumped table!", app_name = "QDebug", level = "debug" } else n { message = tostring(message), app_name = "QDebug", level = "debug" } end end --- Print an info message to stdout and send a notification at the same time ---@param message any function M.info(message) print("[QDebug]: " .. tostring(message)) n { message = message, app_name = "QDebug", level = "info" } end --- Print a warning to stderr and send a notification at the same time ---@param message any function M.warn(message) gdebug.print_warning("[QDebug]: " .. tostring(message)) n { message = message, app_name = "QDebug", level = "warn" } end --- Print an error to stderr and send a notification at the same time ---@param message any function M.error(message) gdebug.print_warning("[QDebug]: " .. tostring(message)) n { message = message, app_name = "QDebug", level = "error" } end return M