Oops, wrong file.
This commit is contained in:
1 parent
87534d309f
commit
9c951f0d21
1 file changed
+20
@@ -87,4 +87,24 @@ sub trans
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Error subroutine.
|
||||||
|
sub err
|
||||||
|
{
|
||||||
|
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("ERROR: $msg");
|
||||||
|
}
|
||||||
|
# Level 2: Log to file.
|
||||||
|
if ($lvl => 2) {
|
||||||
|
API::Log::alog("ERROR: $msg");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
Reference in new issue
Block a user