Refactor a new functions by adding name spaces Startup times are now logged
21 lines
514 B
Plaintext
21 lines
514 B
Plaintext
namespace Logger
|
|
|
|
' Put the file at the root directry to avoid needing to create a folder
|
|
const LOGS_FILE_PATH = "cachefs:/playlet_startup_logs.txt"
|
|
|
|
function Init()
|
|
DeleteFile(LOGS_FILE_PATH)
|
|
end function
|
|
|
|
function Log(msg as string)
|
|
msg = "[APP] " + msg
|
|
' bs:disable-next-line LINT3012
|
|
print(msg)
|
|
|
|
buffer = CreateObject("roByteArray")
|
|
buffer.FromAsciiString(msg + `\n`)
|
|
buffer.AppendFile(LOGS_FILE_PATH)
|
|
end function
|
|
|
|
end namespace
|