21 lines
507 B
Ruby
21 lines
507 B
Ruby
# <<*>> -^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 |