Posted 18 February 2013 - 12:35 AM
What does this program do?
-Saves a log of things that happened while the program was running
-Saves how long the program was running
-Saves how many times the program has been run
-Adds options for what to save/exclude from the log & info
-Does all this in the same file as the code, without messing around with the code or adding any unwanted extras ( apart from a little '^' in the bottom left to quit the program ( uses "terminate" so you can stop it ) )
-Adds a try( functionname, function, …args ) function that will not error( ) ( uses pcall and logs errors )
-Adds a log.add( type, …data ) function to add things to program log
Why?
Usually to make a log or get info about a program you have to create loads of other API's and files to save the information that makes you wish you had never started. This does it all for you
Still to come:
Screenshotting
Only running with certain args
Logging new functions, new variables, if statements etc ( will be able to disable these individually )
Finishing term library rewrite
New options in the info section
Pastebin:
http://pastebin.com/cHqYRbrU
Example:
Code:
After running:
Post any bugs or suggestions below please :D/>
When running the program type "run [run/clear/log] [program name]"
clear will change the program to the original without the extra stuff
run will run it
log will display the log
-Saves a log of things that happened while the program was running
-Saves how long the program was running
-Saves how many times the program has been run
-Adds options for what to save/exclude from the log & info
-Does all this in the same file as the code, without messing around with the code or adding any unwanted extras ( apart from a little '^' in the bottom left to quit the program ( uses "terminate" so you can stop it ) )
-Adds a try( functionname, function, …args ) function that will not error( ) ( uses pcall and logs errors )
-Adds a log.add( type, …data ) function to add things to program log
Why?
Usually to make a log or get info about a program you have to create loads of other API's and files to save the information that makes you wish you had never started. This does it all for you
Still to come:
Screenshotting
Only running with certain args
Logging new functions, new variables, if statements etc ( will be able to disable these individually )
Finishing term library rewrite
New options in the info section
Pastebin:
http://pastebin.com/cHqYRbrU
Example:
Code:
Spoiler
for i = 1,10 do
term.write( "hello" )
sleep( 0.1 )
term.clear( )
term.setCursorPos( 1, 1 )
end
After running:
Spoiler
--test was run
--[[[Info] = Information gathered while program was running
runtime = 0 days, 0 hours, 0 minutes, 1 seconds
times run = 1
]]
--[[[Properties] = File properties
Save Log=true
Exclude From Save Log=
Save running data=true
]]
--Code:
for i = 1,10 do
term.write( "hello" )
sleep( 0.1 )
term.clear( )
term.setCursorPos( 1, 1 )
end
--[[[Program Log] = Welcome to the program log
System - rewriting term library
System - Running program
Trying - shell.run with args: test
Screen - wrote hello at 1 3
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
Screen - wrote hello at 1 1
Screen - cleared
Screen - Set cursor pos to 1 1
System - Saving Event Log
]]
Post any bugs or suggestions below please :D/>
When running the program type "run [run/clear/log] [program name]"
clear will change the program to the original without the extra stuff
run will run it
log will display the log