Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --The Log API 1.0
- function openLog(name)
- h = fs.open("log/"..name..".log", a)
- end
- function closeLog()
- h.close()
- end
- function generateLog() --will create the Dir "log" in the root and create a .log file based on the running program (if if is not already there)
- local runningProgram = shell.getRunningProgram()
- if not fs.exists("log") then
- fs.mkDir("log")
- end
- if not fs.exists("log/"..runningProgram..".log")
- h = fs.open("log/"..runningProgram..".log", a)
- h.writeLine("--- The "..runningProgram.." event log ---")
- h.writeLine(" ")
- h.close()
- end
- end
- function addEntry(type, str)
- local time = os.time()
- local day = os.day()
- h.writeLine("["..day.."]".."["..time.."]".."["..type.."] | #"..str)
- end
- function startLog()
- local time = os.time()
- local day = os.day()
- h.writeLine("["..day.."]".."["..time.."] | #STARTING LOG")
- end
- function endLog()
- local time = os.time()
- local day = os.day()
- h.writeLine("["..day.."]".."["..time.."] | #ENDING LOG")
- end
- function printLog(log, fromPage, toPage,)
- end
Advertisement
Add Comment
Please, Sign In to add comment