Skip to Content.
Sympa Menu

devel - Re: [sympa-developpers] [sympa-commits] sympa[10746] branches/sympa-6.2-branch/src: [dev] Improvement to Log:: do_log().

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: IKEDA Soji <address@concealed>
  • To: address@concealed
  • Subject: Re: [sympa-developpers] [sympa-commits] sympa[10746] branches/sympa-6.2-branch/src: [dev] Improvement to Log:: do_log().
  • Date: Thu, 29 May 2014 11:14:47 +0900

Hi,

On Wed, 28 May 2014 13:28:40 +0200
Guillaume Rousse <address@concealed> wrote:

> Le 26/05/2014 09:30, address@concealed a écrit :
> > Revision
> > 10746
> > Author
> > sikeda
> > Date
> > 2014-05-26 09:30:38 +0200 (lun. 26 mai 2014)
> >
> >
> > Log Message
> >
> > [dev] Improvement to Log::do_log().
> > - Log::do_log() can handle object arguments. If a parameter value is
> > blessed and implements method named get_id(), its result is used.
> Better solution: overload stringification operator for each class, as
> you've done for Sympa::Robot, to produce human-readable traces without
> having to manually inspect each parameter.
>
> That's more efficient first (two tests less for every parameter for
> every call) and more generalisable (string interpolation, for instance).

I agree to the second paragraph. However, I wish to reserve ""
overloading for more valuable use.

BTW use of overloading in Rebot is to _prevent_ stringification so
that programmers who mistakenly handle object with obsoleted style
(string containing the name of robot) will be warned. This would be
removed when transition to OO style will be completed.

Regards,


--- Soji

--
株式会社 コンバージョン セキュリティ&OSSソリューション部 池田荘児
〒231-0004 神奈川県横浜市中区元浜町3-21-2 ヘリオス関内ビル7F
e-mail address@concealed TEL 045-640-3550
http://www.conversion.co.jp/



Archive powered by MHonArc 2.6.19+.

Top of Page