aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2007-09-04 00:22:32 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2007-09-04 00:22:32 -0500
commitcb71b4df0b70208345a068ac089a56cc8b9dd12c (patch)
tree9c9fb1f72cedec136f13689b8c9870683834639c
parentecf89e841c46781413a00a3653e523ec3b22ad71 (diff)
downloadluairc-cb71b4df0b70208345a068ac089a56cc8b9dd12c.tar.gz
luairc-cb71b4df0b70208345a068ac089a56cc8b9dd12c.zip
split between internal/public functions in debug.lua
-rw-r--r--src/irc/debug.lua70
1 files changed, 36 insertions, 34 deletions
diff --git a/src/irc/debug.lua b/src/irc/debug.lua
index 9082996..414b49d 100644
--- a/src/irc/debug.lua
+++ b/src/irc/debug.lua
@@ -19,40 +19,15 @@ local ON = false
local outfile = io.output()
-- }}}
--- public functions {{{
--- enable {{{
----
--- Turns on debug output.
-function enable()
- ON = true
-end
--- }}}
-
--- disable {{{
----
--- Turns off debug output.
-function disable()
- ON = false
-end
--- }}}
-
--- set_output {{{
----
--- Redirects output to a file rather than stdout.
--- @param file File to write debug output to
-function set_output(file)
- outfile = base.assert(io.open(file))
-end
--- }}}
-
--- message {{{
+-- internal functions {{{
+-- _message {{{
--
-- Output a debug message.
-- @param msg_type Arbitrary string corresponding to the type of message
-- @param msg Message text
-- @param color Which terminal code to use for color output (defaults to
-- dark gray)
-function message(msg_type, msg, color)
+function _message(msg_type, msg, color)
if ON then
local endcolor = ""
if COLOR and outfile == io.stdout then
@@ -67,24 +42,51 @@ function message(msg_type, msg, color)
end
-- }}}
--- err {{{
+-- _err {{{
--
-- Signal an error. Writes the error message to the screen in red and calls
-- error().
-- @param msg Error message
-- @see error
-function err(msg)
- message("ERR", msg, "\027[0;31m")
+function _err(msg)
+ _message("ERR", msg, "\027[0;31m")
base.error(msg, 2)
end
-- }}}
--- warn {{{
+-- _warn {{{
--
-- Signal a warning. Writes the warning message to the screen in yellow.
-- @param msg Warning message
-function warn(msg)
- message("WARN", msg, "\027[0;33m")
+function _warn(msg)
+ _message("WARN", msg, "\027[0;33m")
+end
+-- }}}
+-- }}}
+
+-- public functions {{{
+-- enable {{{
+---
+-- Turns on debug output.
+function enable()
+ ON = true
+end
+-- }}}
+
+-- disable {{{
+---
+-- Turns off debug output.
+function disable()
+ ON = false
+end
+-- }}}
+
+-- set_output {{{
+---
+-- Redirects output to a file rather than stdout.
+-- @param file File to write debug output to
+function set_output(file)
+ outfile = base.assert(io.open(file))
end
-- }}}
-- }}}