Added awarn() to API::Std for warnings.

This commit is contained in:
Elijah Perrault committed 2011-01-20 21:43:39 -07:00
1 parent 60ad4803af
commit 8ca426316a
2 files changed
+21

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
==================================================================
* Added awarn() to API::Std for warnings.
* Parse Numeric:432.
* Parse Numeric:433.
* Added nick() to API::IRC.
+20
View File
@@ -193,4 +193,24 @@ sub err
}
}
# Warn subroutine.
sub awarn
{
my ($lvl, $msg) = @_;
# Check for an invalid level.
if ($lvl =~ m/[^0-9]/) {
return 0;
}
# Level 1: Print to screen.
if ($lvl >= 1) {
API::Log::println("WARNING: $msg");
}
# Level 2: Log to file.
if ($lvl >= 2) {
API::Log::alog("WARNING: $msg");
}
}
1;