Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: Balancing Logging and Code Readability

by saberworks (Curate)
on Sep 14, 2009 at 17:24 UTC ( [id://795188]=note: print w/replies, xml ) Need Help??


in reply to Re: Balancing Logging and Code Readability
in thread Balancing Logging and Code Readability

I've had the same problem as the OP and the idea of adding a syntax rule to recognize log lines and highlight them as comments crossed my mind as well. Then I remembered I saw a perl module on CPAN once that allowed you to write comments in a special way that would be logged. I can't seem to find it after ~10 minutes of searching but it did look interesting so if this rings a bell for someone else, please post a follow-up.

Replies are listed 'Best First'.
Re^3: Balancing Logging and Code Readability
by BrowserUk (Patriarch) on Sep 14, 2009 at 17:36 UTC
      Ah, yes, Smart::Comments is the one I remember seeing. Looks like a cool module and may help the OP. However, there are quite a few bugs open and no new release in a year and a half, so that may be something to consider.

        Smart::Comments is very useful for debugging, but not so good for permanent logging as it uses a source filter which most people elect not to use in production code.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.

        I'll look into that module. It sounds interesting. Thanks saberwords and BrowserUk.

        ack Albuquerque, NM
Re^3: Balancing Logging and Code Readability
by dinomite (Sexton) on Sep 15, 2009 at 05:01 UTC
    Since you're already using Log::Log4perl, you might check out it's built-in :resurrect tag or the similar functionality provided by Filter::Log4perl.

      I have seen the :resurrect tag but haven't really looked into it. The quick glance that I gave it didn't really connect in my mind that it might be helpful to my dilema. I hadn't seen the Filter::Log4perl module, so I'll definitely look into it.

      Thanks for the suggestions. I'll look into them.

      ack Albuquerque, NM

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://795188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-03-28 14:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found