Files
sentinel/uni_log_path.rb
T

21 lines
507 B
Ruby
Raw Normal View History

2026-06-07 11:05:26 +08:00
# <<*>> -^v- SNOWARE APPLICATION
# usage: UNIVERSAL
# author: S.A.
# time: 2026-06-07
# license: All rights received.
# CRITICAL! This function decides where the log file will be stored.
def generate_logfile_path(
proc_duty = "MineSentinel",
time_format = "%Y%m%d_%H%M"
)
# Ensure that destination exists.
result = system "mkdir -p /var/log/snoware"
if not result
raise Errno::EBADEXEC
end
return "/var/log/snoware" + "/" + proc_duty + "/" + Time.now.strftime(time_format) + ".log"
end