You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by ge...@apache.org on 2004/01/19 17:25:54 UTC
cvs commit: modperl-2.0/xs/maps modperl_functions.map
geoff 2004/01/19 08:25:54
Modified: t/response/TestAPI aplog.pm
xs/Apache/Log Apache__Log.h
xs/maps modperl_functions.map
Log:
Apache::LOG_MARK() is now Apache::Log::LOG_MARK()
Revision Changes Path
1.16 +4 -4 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.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- aplog.pm 19 Jan 2004 16:19:09 -0000 1.15
+++ aplog.pm 19 Jan 2004 16:25:54 -0000 1.16
@@ -31,7 +31,7 @@
$rlog->info($package, " test in progress");
- my($file, $line) = Apache::LOG_MARK;
+ my($file, $line) = Apache::Log::LOG_MARK;
ok $file eq __FILE__;
ok $line == __LINE__ - 2;
@@ -41,7 +41,7 @@
ok sub { $slog->can($method) };
}
- $s->log_serror(Apache::LOG_MARK, Apache::LOG_INFO|Apache::LOG_STARTUP,
+ $s->log_serror(Apache::Log::LOG_MARK, Apache::LOG_INFO|Apache::LOG_STARTUP,
APR::SUCCESS, "This log message comes with no header");
t_server_log_warn_is_expected();
@@ -49,11 +49,11 @@
APR::SUCCESS, "log_serror test ok");
t_server_log_warn_is_expected();
- $s->log_serror(Apache::LOG_MARK, Apache::LOG_DEBUG,
+ $s->log_serror(Apache::Log::LOG_MARK, Apache::LOG_DEBUG,
APR::EGENERAL, "log_serror test 2 ok");
t_server_log_error_is_expected();
- $r->log_rerror(Apache::LOG_MARK, Apache::LOG_CRIT,
+ $r->log_rerror(Apache::Log::LOG_MARK, Apache::LOG_CRIT,
APR::ENOTIME, "log_rerror test ok");
t_server_log_error_is_expected();
1.12 +1 -1 modperl-2.0/xs/Apache/Log/Apache__Log.h
Index: Apache__Log.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/Apache/Log/Apache__Log.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- Apache__Log.h 14 Aug 2002 14:54:47 -0000 1.11
+++ Apache__Log.h 19 Jan 2004 16:25:54 -0000 1.12
@@ -181,7 +181,7 @@
XSRETURN_EMPTY;
}
-static XS(MPXS_Apache_LOG_MARK)
+static XS(MPXS_Apache__Log_LOG_MARK)
{
dXSARGS;
ax = ax; /* -Wall */;
1.66 +1 -1 modperl-2.0/xs/maps/modperl_functions.map
Index: modperl_functions.map
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- modperl_functions.map 14 Jan 2004 21:27:41 -0000 1.65
+++ modperl_functions.map 19 Jan 2004 16:25:54 -0000 1.66
@@ -114,6 +114,7 @@
DEFINE_info | MPXS_Apache__Log_dispatch | ...
DEFINE_debug | MPXS_Apache__Log_dispatch | ...
DEFINE_crit | MPXS_Apache__Log_dispatch | ...
+DEFINE_LOG_MARK | MPXS_Apache__Log_LOG_MARK | ...
PACKAGE=Apache::RequestRec
SV *:DEFINE_log | | SV *:obj
@@ -127,7 +128,6 @@
DEFINE_warn | MPXS_Apache__Log_log_error | ...
PACKAGE=Apache
-DEFINE_LOG_MARK | MPXS_Apache_LOG_MARK | ...
DEFINE_warn | MPXS_Apache__Log_log_error | ...
MODULE=Apache::SubProcess
Re: cvs commit: modperl-2.0/xs/maps modperl_functions.map
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>>> Apache::LOG_MARK() is now Apache::Log::LOG_MARK()
>>
>>
>>So it shouldn't be called LOG_MARK, it's an ugly duplication: Log::LOG
>>
>>How about Apache::Log::MARK?
>
>
> I thought about that, but we currently use Apache::Log::LOG_ERR,
> Apache::Log::LOG_DEBUG, etc for the constants, so I figured to keep the LOG_
> prefix for LOG_MARK. of course, it's rather confusing that LOG_MARK is
> itself a function, so if we're going to take away the LOG_ prefix I'd rather
> call it Apache::Log::mark() so that it's clear it's a function.
we could s/Apache::Log::LOG_DEBUG/Apache::Log::DEBUG/ as well (and the rest),
but if you import the constant, then it's confusing not to have the LOG_ prefix.
I guess Doug called LOG_MARK the same way as the log constants, so it'll look
like a constant.
I wonder why do we need it at all:
static XS(MPXS_Apache__Log_LOG_MARK)
{
dXSARGS;
ax = ax; /* -Wall */;
mpxs_PPCODE({
COP *cop = PL_curcop;
if (items) {
Perl_croak(aTHX_ "usage %s::%s()", mpxs_cv_name());
}
EXTEND(SP, 2);
PUSHs_mortal_pv(CopFILE(cop));
PUSHs_mortal_iv(CopLINE(cop));
});
}
it just returns __FILE__, __LINE__, nothing special to logging. I suppose the
only reason it sinked into the mp2 API is because Apache uses APLOG_MARK macro:
#define APLOG_MARK __FILE__,__LINE__
in calls to ap_log_*
I don't know what's the best route to take here, but Apache::Log::LOG_ reads ugly.
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: cvs commit: modperl-2.0/xs/maps modperl_functions.map
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
>> Apache::LOG_MARK() is now Apache::Log::LOG_MARK()
>
>
> So it shouldn't be called LOG_MARK, it's an ugly duplication: Log::LOG
>
> How about Apache::Log::MARK?
I thought about that, but we currently use Apache::Log::LOG_ERR,
Apache::Log::LOG_DEBUG, etc for the constants, so I figured to keep the LOG_
prefix for LOG_MARK. of course, it's rather confusing that LOG_MARK is
itself a function, so if we're going to take away the LOG_ prefix I'd rather
call it Apache::Log::mark() so that it's clear it's a function.
--Geoff
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: cvs commit: modperl-2.0/xs/maps modperl_functions.map
Posted by Stas Bekman <st...@stason.org>.
geoff@apache.org wrote:
> geoff 2004/01/19 08:25:54
>
> Modified: t/response/TestAPI aplog.pm
> xs/Apache/Log Apache__Log.h
> xs/maps modperl_functions.map
> Log:
> Apache::LOG_MARK() is now Apache::Log::LOG_MARK()
So it shouldn't be called LOG_MARK, it's an ugly duplication: Log::LOG
How about Apache::Log::MARK?
> Revision Changes Path
> 1.16 +4 -4 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.15
> retrieving revision 1.16
> diff -u -r1.15 -r1.16
> --- aplog.pm 19 Jan 2004 16:19:09 -0000 1.15
> +++ aplog.pm 19 Jan 2004 16:25:54 -0000 1.16
> @@ -31,7 +31,7 @@
>
> $rlog->info($package, " test in progress");
>
> - my($file, $line) = Apache::LOG_MARK;
> + my($file, $line) = Apache::Log::LOG_MARK;
> ok $file eq __FILE__;
> ok $line == __LINE__ - 2;
>
> @@ -41,7 +41,7 @@
> ok sub { $slog->can($method) };
> }
>
> - $s->log_serror(Apache::LOG_MARK, Apache::LOG_INFO|Apache::LOG_STARTUP,
> + $s->log_serror(Apache::Log::LOG_MARK, Apache::LOG_INFO|Apache::LOG_STARTUP,
> APR::SUCCESS, "This log message comes with no header");
>
> t_server_log_warn_is_expected();
> @@ -49,11 +49,11 @@
> APR::SUCCESS, "log_serror test ok");
>
> t_server_log_warn_is_expected();
> - $s->log_serror(Apache::LOG_MARK, Apache::LOG_DEBUG,
> + $s->log_serror(Apache::Log::LOG_MARK, Apache::LOG_DEBUG,
> APR::EGENERAL, "log_serror test 2 ok");
>
> t_server_log_error_is_expected();
> - $r->log_rerror(Apache::LOG_MARK, Apache::LOG_CRIT,
> + $r->log_rerror(Apache::Log::LOG_MARK, Apache::LOG_CRIT,
> APR::ENOTIME, "log_rerror test ok");
>
> t_server_log_error_is_expected();
>
>
>
> 1.12 +1 -1 modperl-2.0/xs/Apache/Log/Apache__Log.h
>
> Index: Apache__Log.h
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/xs/Apache/Log/Apache__Log.h,v
> retrieving revision 1.11
> retrieving revision 1.12
> diff -u -r1.11 -r1.12
> --- Apache__Log.h 14 Aug 2002 14:54:47 -0000 1.11
> +++ Apache__Log.h 19 Jan 2004 16:25:54 -0000 1.12
> @@ -181,7 +181,7 @@
> XSRETURN_EMPTY;
> }
>
> -static XS(MPXS_Apache_LOG_MARK)
> +static XS(MPXS_Apache__Log_LOG_MARK)
> {
> dXSARGS;
> ax = ax; /* -Wall */;
>
>
>
> 1.66 +1 -1 modperl-2.0/xs/maps/modperl_functions.map
>
> Index: modperl_functions.map
> ===================================================================
> RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
> retrieving revision 1.65
> retrieving revision 1.66
> diff -u -r1.65 -r1.66
> --- modperl_functions.map 14 Jan 2004 21:27:41 -0000 1.65
> +++ modperl_functions.map 19 Jan 2004 16:25:54 -0000 1.66
> @@ -114,6 +114,7 @@
> DEFINE_info | MPXS_Apache__Log_dispatch | ...
> DEFINE_debug | MPXS_Apache__Log_dispatch | ...
> DEFINE_crit | MPXS_Apache__Log_dispatch | ...
> +DEFINE_LOG_MARK | MPXS_Apache__Log_LOG_MARK | ...
>
> PACKAGE=Apache::RequestRec
> SV *:DEFINE_log | | SV *:obj
> @@ -127,7 +128,6 @@
> DEFINE_warn | MPXS_Apache__Log_log_error | ...
>
> PACKAGE=Apache
> -DEFINE_LOG_MARK | MPXS_Apache_LOG_MARK | ...
> DEFINE_warn | MPXS_Apache__Log_log_error | ...
>
> MODULE=Apache::SubProcess
>
>
>
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org