dougm 01/05/03 15:24:06
Modified: lib/Apache ParseSource.pm
lib/ModPerl Code.pm
t/response/TestAPI aplog.pm
xs/tables/current/Apache ConstantsTable.pm
Log:
add APLOG_* constants and tests
Revision Changes Path
1.17 +2 -1 modperl-2.0/lib/Apache/ParseSource.pm
Index: ParseSource.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/Apache/ParseSource.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- ParseSource.pm 2001/04/19 17:22:54 1.16
+++ ParseSource.pm 2001/05/03 22:23:53 1.17
@@ -139,6 +139,7 @@
# config => [qw{DECLINE_CMD}],
# types => [qw{DIR_MAGIC_TYPE}],
override => [qw{OR_ ACCESS_CONF RSRC_CONF}],
+ log => [qw(APLOG_)],
},
APR => {
poll => [qw{APR_POLL}],
@@ -169,7 +170,7 @@
);
my $defines_unwanted = join '|', qw{
-HTTP_VERSION APR_EOL_STR
+HTTP_VERSION APR_EOL_STR APLOG_MARK
};
sub get_constants {
1.61 +4 -4 modperl-2.0/lib/ModPerl/Code.pm
Index: Code.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- Code.pm 2001/04/30 04:37:00 1.60
+++ Code.pm 2001/05/03 22:23:58 1.61
@@ -1,7 +1,7 @@
package ModPerl::Code;
use strict;
-use warnings;
+use warnings FATAL => 'all';
use mod_perl ();
use Apache::Build ();
@@ -731,8 +731,8 @@
EOF
for (@$constants) {
- if (s/^($constant_prefixes)_//o) {
- $alias{$_} = join '_', $1, $_;
+ if (s/^($constant_prefixes)(_)?//o) {
+ $alias{$_} = join $2 || "", $1, $_;
}
else {
$alias{$_} ||= $_;
@@ -791,7 +791,7 @@
push @tags, $group;
my $name = join '_', 'MP_constants', $class, $group;
print $c_fh "\nstatic const char *$name [] = { \n",
- (map { s/^($constant_prefixes)_//o;
+ (map { s/^($constant_prefixes)_?//o;
qq( "$_",\n) } @$constants), " NULL,\n};\n";
}
1.2 +8 -2 modperl-2.0/t/response/TestAPI/aplog.pm
Index: aplog.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/aplog.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- aplog.pm 2001/05/03 06:20:58 1.1
+++ aplog.pm 2001/05/03 22:24:01 1.2
@@ -5,12 +5,14 @@
use Apache::Log ();
use Apache::Test;
+use Apache::Const -compile => ':log';
my @LogLevels = qw(emerg alert crit error warn notice info debug);
my $package = __PACKAGE__;
sub handler {
my $r = shift;
+ my $s = $r->server;
plan $r, tests => (@LogLevels * 2) + 3;
@@ -18,7 +20,7 @@
ok $rlog->isa('Apache::Log::Request');
- my $slog = $r->server->log;
+ my $slog = $s->log;
ok $slog->isa('Apache::Log::Server');
@@ -30,7 +32,11 @@
ok sub { $slog->can($method) };
}
- $slog->info(sub { ok 1; "$package test done" });
+ $s->loglevel(Apache::LOG_INFO);
+ $slog->debug(sub { die "set loglevel no workie" });
+
+ $s->loglevel(Apache::LOG_DEBUG);
+ $slog->debug(sub { ok 1; "$package test done" });
Apache::OK;
}
1.7 +14 -1 modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm
Index: ConstantsTable.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/tables/current/Apache/ConstantsTable.pm,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ConstantsTable.pm 2001/04/19 17:45:21 1.6
+++ ConstantsTable.pm 2001/05/03 22:24:04 1.7
@@ -2,7 +2,7 @@
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
# ! WARNING: generated by Apache::ParseSource/0.02
-# ! Thu Apr 19 10:01:37 2001
+# ! Thu May 3 15:00:16 2001
# ! do NOT edit, any changes will be lost !
# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -132,6 +132,19 @@
'ACCESS_CONF',
'RSRC_CONF',
'OR_ALL'
+ ],
+ 'log' => [
+ 'APLOG_EMERG',
+ 'APLOG_ALERT',
+ 'APLOG_CRIT',
+ 'APLOG_ERR',
+ 'APLOG_WARNING',
+ 'APLOG_NOTICE',
+ 'APLOG_INFO',
+ 'APLOG_DEBUG',
+ 'APLOG_LEVELMASK',
+ 'APLOG_NOERRNO',
+ 'APLOG_STARTUP'
],
'remotehost' => [
'REMOTE_HOST',