Added awarn() to API::Std for warnings.
This commit is contained in:
1 parent
60ad4803af
commit
8ca426316a
2 files changed
+21
No files matched your search
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
Reference in new issue
Block a user