[osflash] RE: Loggers

Carlos Rovira carlos.rovira at gmail.com
Wed Jun 22 23:23:08 PDT 2005


Hi Scott,

Great idea! I've seen this sometimes in code but I never stop to think
a bit about it, I'll try to implement in my singelton managers and
classes too, thanks!

: )

2005/6/23, Scott Whittaker <whittaker007 at hotmail.com>:
> Hi Pablo,
> 
> One suggestion for your logger: while it is cool to allow singleton access
> with Logger.getInstance() it is even cooler if you make the Singleton access
> private and call it from within the public static methods of the Logger.
> 
> For example, instead of requiring the syntax:
> 
> Logger.getInstance().log ("message");
> 
> You can shorten it to:
> 
> Logger.log ("message");
> 
> And inside your public static "log" method make the call to the private
> "getInstance" method. I have used this pattern in a few of my static Manager
> classes and it works really well and makes your code neater. I've never seen
> anyone else do this, I don't know if it is considered "bad form" or anything
> but it works great for me  :)
> 
> Kind regards,
> 
> Scott W.
> 
> _________________________________________________________________
> Need a new job? Check out XtraMSN Careers http://xtramsn.co.nz/careers
> 
> _______________________________________________
> osflash mailing list
> osflash at osflash.org
> http://osflash.org/mailman/listinfo/osflash_osflash.org
> 


-- 
::| Carlos Rovira
::| http://www.carlosrovira.com



More information about the osflash mailing list