Re: if not DEBUG: log = null_log

2005-07-12 Thread @(none)
Bengt Richter wrote: > On Wed, 13 Jul 2005 11:00:14 +1000, Simon Burton <[EMAIL PROTECTED]> wrote: > > >>Hi, >> >>I'm after a no-op command, so that i can redirect >>logging commands in performance critical code. >> >>Something like this: >> >>def log(*args): print args >>def null_log(*args): pas

Re: if not DEBUG: log = null_log

2005-07-12 Thread Bengt Richter
On Wed, 13 Jul 2005 11:00:14 +1000, Simon Burton <[EMAIL PROTECTED]> wrote: > >Hi, > >I'm after a no-op command, so that i can redirect >logging commands in performance critical code. > >Something like this: > >def log(*args): print args >def null_log(*args): pass >if not DEBUG: log = null_log > >

Re: if not DEBUG: log = null_log

2005-07-12 Thread Steven D'Aprano
On Wed, 13 Jul 2005 11:00:14 +1000, Simon Burton wrote: > Hi, > > I'm after a no-op command, so that i can redirect > logging commands in performance critical code. > > Something like this: > > def log(*args): print args > def null_log(*args): pass > if not DEBUG: log = null_log > > is unaccep