Auto4: Added aegisub.log as synonym for aegisub.debug.out

Originally committed to SVN as r836.
This commit is contained in:
Niels Martin Hansen 2007-01-18 20:55:40 +00:00
parent bbfb0e94d0
commit 1dff6b2139
3 changed files with 11 additions and 4 deletions

View File

@ -718,6 +718,9 @@ namespace Automation4 {
lua_pushcclosure(L, LuaDebugOut, 1);
lua_setfield(L, -2, "out");
lua_setfield(L, -2, "debug");
lua_pushvalue(L, -2);
lua_pushcclosure(L, LuaDebugOut, 1);
lua_setfield(L, -2, "log");
if (allow_config_dialog) {
lua_newtable(L);

View File

@ -1,15 +1,15 @@
script_name = "Automation 4 test 9"
script_description = "Test debug out function"
script_author = "Niels Martin Hansen"
script_version = "1"
script_version = "2"
function test9(subtitles, selected_lines, active_line)
aegisub.debug.out("Only string argument\n")
aegisub.debug.out("Hello %s!\n", "format string world")
aegisub.debug.out("Now going to output 7 strings with trace levels 0 to 6:\n")
aegisub.log("Now going to log 7 strings with trace levels 0 to 6:\n")
for i = 0, 6 do
aegisub.debug.out(i, "Trace level %d...\n", i)
aegisub.log(i, "Trace level %d...\n", i)
end
aegisub.debug.out(3, "Finished!")
end

View File

@ -69,8 +69,12 @@ Returns: Boolean. True is the user has clicked the Cancel button, false if it
Outputting text to the debug log
function aegisub.log([level,] msg, ...)
function aegisub.debug.out([level,] msg, ...)
These two functions are synonyms.
aegisub.log is preferred since its name is shorter and more general.
@level (number)
Integer describing the verbosity of this message. Here are some suggested
values you can use:
@ -87,7 +91,7 @@ function aegisub.debug.out([level,] msg, ...)
script won't see them unless he explicitly enables it.
This argument is optional and can be left out, in which case the message
will always be displayed, regardless of the current trace level set in
Aegisub.
Aegisub. You SHOULD however always include this argument.
@msg (string)
A format string used for the message.