Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

jonasbn (1153)

jonasbn
  reversethis-{gro.napc} {ta} {nbsanoj}
http://e-diot.dk/
AOL IM: BJonasN (Add Buddy, Send Message)

Perl Programmer located in Copenhagen, Denmark. Active member of Copenhagen Perl Mongers.

Author of:

  • Business::DK::CPR
  • Business::DK::CVR
  • Business::DK::PO
  • Business::OnlinePayment::CashCow
  • Date::Holidays
  • Date::Holidays::Abstract
  • Date::Holidays::Super
  • Date::Pregnancy
  • Games::Bingo
  • Games::Bingo::Bot
  • Games::Bingo::Print
  • Module::Info::File
  • Module::Template::Setup
  • Test::Timer

and maintainer of:

  • Tie::Tools
  • XML::Conf
  • Workflow

Journal of jonasbn (1153)

Monday January 28, 2008
06:01 AM

Prepping for Production (staging)

[ #35501 ]

This entry is somewhat in line with my previous journal entry on comments in code.

Way too often we are so busy we do not get our code completely prepped for production.

This mean commented-out code is not removed, code is not peer-reviewed and POD is not updated (if written at all).

I have other issues like lacking tests, documentation aso. but lets stick to the topic.

I would live to see a proper staging process and use of a staging platform, I looked up the word in my dictionary and it said (somewhat edited):

stage |stāj| noun

*snip*

- each of two or more sections of a rocket or spacecraft that have their own engines and are jettisoned in turn when their propellant is exhausted.

*snip*

Man, this is exactly what I mean, throw away the parts you do not need. I would love if we could would just go over the code at least once and remove the debris of the development.

And next we go over the code and isolate all debugging and verbose logging so it
can be controlled using flags from a single point.

Other things we could do?

We can always adopt peer reviews when we get the time.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • And next we go over the code and isolate all debugging and verbose logging so it can be controlled using flags from a single point.

    Did you mean: Log::Log4perl [cpan.org]

    • Nah, more in the line of:


      print STDERR "We are now in func2\n";
      print STDERR "we got params:\n", Dumper \@params;


      We have a lot of such code. I attempt only to inject
      when really desperately debugging or atleast isolating it behind


      if (DEBUG) { ... }
      • That’s the point: with Log4perl, you can leave it in. You configure at runtime precisely which logging messages you’re interested in (yes, while the program runs – not just at startup).

        Furthermore, if you worry about expensive computations in your logging statements, you can pass a closure instead of a string, which will be invoked only if that statement is enabled. The logger call still happens, so this is not as efficient as if (DEBUG) { ... } (which is completely optimised away at com

        • I utilize log4perl with the Workflow distribution, but not for work currently. I will investigate if we can make use of log4perl in this setup.

          Thanks,
          • Ah, didn’t know you knew it already. A lot of people don’t, and logging is one of those things where it’s really really easy to understand and solve 30% of the problem, but it’s hard to imagine the whole problem and a lot of work to solve it well, so it’s common to get stuck at the 30% threshold.

            I was stuck there too before I read an article about Log4perl. It really opened my eyes – I had been doing things in a pretty crappy way but it never occurred to me I could have

        • > if you worry about expensive computations in your logging statements, you can pass a closure instead of a string.

          *Light Bulb Moment*

          Oh wow, why did I never think of that before.