perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: modperl-2.0/xs/maps modperl_functions.map
Date Mon, 02 Feb 2004 20:32:55 GMT
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


Mime
View raw message