From 7cb9ec47986fd1fb71d8ab379097ebca8b888b57 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 14 Feb 2019 16:21:55 +0100 Subject: [PATCH] gears.timer: Use gears.debug.print_error (#2647) Signed-off-by: Uli Schlachter --- lib/gears/timer.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/gears/timer.lua b/lib/gears/timer.lua index c01b49f4..57f89495 100644 --- a/lib/gears/timer.lua +++ b/lib/gears/timer.lua @@ -60,6 +60,7 @@ local unpack = unpack or table.unpack -- luacheck: globals unpack (compatibility local glib = require("lgi").GLib local object = require("gears.object") local protected_call = require("gears.protected_call") +local gdebug = require("gears.debug") --- Timer objects. This type of object is useful when triggering events repeatedly. -- The timer will emit the "timeout" signal every N seconds, N being the timeout @@ -85,7 +86,7 @@ local timer = { mt = {} } --- Start the timer. function timer:start() if self.data.source_id ~= nil then - print(traceback("timer already started")) + gdebug.print_error(traceback("timer already started")) return end self.data.source_id = glib.timeout_add(glib.PRIORITY_DEFAULT, self.data.timeout * 1000, function() @@ -98,7 +99,7 @@ end --- Stop the timer. function timer:stop() if self.data.source_id == nil then - print(traceback("timer not started")) + gdebug.print_error(traceback("timer not started")) return end glib.source_remove(self.data.source_id)