Files
infinsweeper/logman.rb
2025-09-03 15:36:28 +01:00

12 lines
345 B
Ruby

# module for logging
module Logman
def self.log(log)
file, line = caller(1, 1)[0].split(":")
File.write("log/main.log", "[#{Time.now}] {#{file}:#{line}} #{log}\n", mode: "a") if ENV_HASH["ENV"] == "dev"
end
def self.imp(log)
File.write("log/imp.log", "[#{Time.now}] #{log}\n", mode: "a") if ENV_HASH["ENV"] == "dev"
end
end