From 75d8c4f5c0b52b0e1743cc5cc12b4c1cc0abaf91 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 24 Jan 2019 12:16:10 -0600 Subject: [PATCH] Use logger instead of STDOUT --- src/invidious/jobs.cr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/invidious/jobs.cr b/src/invidious/jobs.cr index df02c7fb..81271cb3 100644 --- a/src/invidious/jobs.cr +++ b/src/invidious/jobs.cr @@ -21,7 +21,7 @@ def crawl_videos(db) id = ids[0] video = get_video(id, db) rescue ex - STDOUT << id << " : " << ex.message << "\n" + logger.write("#{id} : #{ex.message}\n") next ensure ids.delete(id) @@ -73,7 +73,7 @@ def refresh_channels(db, max_threads = 1, full_refresh = false) db.exec("UPDATE channels SET updated = $1, author = $2 WHERE id = $3", Time.now, channel.author, id) rescue ex - STDOUT << id << " : " << ex.message << "\n" + logger.write("#{id} : #{ex.message}\n") end active_channel.send(true) @@ -94,7 +94,7 @@ def refresh_videos(db) id = rs.read(String) video = get_video(id, db) rescue ex - STDOUT << id << " : " << ex.message << "\n" + logger.write("#{id} : #{ex.message}\n") next end end @@ -129,7 +129,7 @@ def refresh_feeds(db, max_threads = 1) begin db.exec("REFRESH MATERIALIZED VIEW #{view_name}") rescue ex - STDOUT << "REFRESH " << email << " : " << ex.message << "\n" + logger.write("REFRESH #{email} : #{ex.message}\n") end active_channel.send(true)