Added a debug mode.
This commit is contained in:
1 parent
293b08a761
commit
3118964e80
2 files changed
+14
No files matched your search
@@ -23,6 +23,7 @@ use Parser::Lang;
|
|||||||
#use Parser::IRC;
|
#use Parser::IRC;
|
||||||
#use Sys;
|
#use Sys;
|
||||||
|
|
||||||
|
# Set version information.
|
||||||
use constant {
|
use constant {
|
||||||
NAME => 'Auto IRC Bot',
|
NAME => 'Auto IRC Bot',
|
||||||
VER => 3,
|
VER => 3,
|
||||||
@@ -31,9 +32,19 @@ use constant {
|
|||||||
RSTAGE => 'd'
|
RSTAGE => 'd'
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Check for debug mode.
|
||||||
|
our $DEBUG = 0;
|
||||||
|
if (defined $ARGV[0]) {
|
||||||
|
if ($ARGV[0] eq '-d') {
|
||||||
|
$DEBUG = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Parse configuration file.
|
||||||
our $CONF = Parser::Config->new("auto.conf") or print "Failed to open configuration file.\n" and exit;
|
our $CONF = Parser::Config->new("auto.conf") or print "Failed to open configuration file.\n" and exit;
|
||||||
our %SETTINGS = $CONF->parse;
|
our %SETTINGS = $CONF->parse;
|
||||||
|
|
||||||
|
# Parse translations.
|
||||||
my @lclv = API::Std::conf_get("locale");
|
my @lclv = API::Std::conf_get("locale");
|
||||||
our $LOCALE = $lclv[0][0];
|
our $LOCALE = $lclv[0][0];
|
||||||
my @lang = split('_', $LOCALE);
|
my @lang = split('_', $LOCALE);
|
||||||
@@ -41,4 +52,5 @@ Parser::Lang::parse($lang[0]);
|
|||||||
undef @lang;
|
undef @lang;
|
||||||
undef @lclv;
|
undef @lclv;
|
||||||
|
|
||||||
|
# Expire old logs.
|
||||||
API::Log::expire_logs();
|
API::Log::expire_logs();
|
||||||
@@ -3,6 +3,8 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
==================================================================
|
==================================================================
|
||||||
|
* Added a debug mode.
|
||||||
|
* Old logs can now expire if set to do so in config.
|
||||||
* Added API function alog()
|
* Added API function alog()
|
||||||
* Added API::Log::expire_logs()
|
* Added API::Log::expire_logs()
|
||||||
* Added API function println()
|
* Added API function println()
|
||||||
|
|||||||
Reference in new issue
Block a user