From 7e20ea09dbbd6cfc37721cefba11154560e27bbc Mon Sep 17 00:00:00 2001 From: Alexey Berezhok Date: Sat, 21 Feb 2026 23:32:39 +0300 Subject: [PATCH] Back logging --- app.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app.rb b/app.rb index cf57094..738402b 100644 --- a/app.rb +++ b/app.rb @@ -35,17 +35,17 @@ require_relative 'models/userdata' require_relative 'classes/cert' require_relative 'classes/pagination' -# configure do -# Dir.mkdir('logs') unless Dir.exist?('logs') -# unless File.exist?('logs/actions.log') -# File.new('logs/actions.log', 'w').close -# end -# log_file = File.open('logs/actions.log', 'a+') -# STDOUT.reopen(log_file) -# STDERR.reopen(log_file) -# STDOUT.sync = true -# STDERR.sync = true -# end +configure do + Dir.mkdir('logs') unless Dir.exist?('logs') + unless File.exist?('logs/actions.log') + File.new('logs/actions.log', 'w').close + end + log_file = File.open('logs/actions.log', 'a+') + STDOUT.reopen(log_file) + STDERR.reopen(log_file) + STDOUT.sync = true + STDERR.sync = true +end set :bind, IPBIND set :port, PORT