Re: [PHP] static Logging class?

2013-03-03 Thread Ravi Gehlot
Hello Lars, I would apply the Singleton Pattern where you would have 1 instance for you entire application. As far as whether or not to use a static method, I would weigh the options. If you just want to call a method that you know will not have to be changed in the future and that method will

Re: [PHP] static Logging class?

2013-03-03 Thread Larry Garfield
Make a real classed object that you pass to various objects that need it. Otherwise you make your life way harder for unit testing. Don't have a class that self-enforces that it's a singleton. That way lies pain. In particular, I recommend using or writing a class based on the PSR-3

Re: [PHP] static Logging class?

2013-03-03 Thread Lars Nielsen
Thanks a lot Larry! This PSR-3 looks just the way to do such things! :-) I hope i chat with you at DrupalCon Praha! http://www.linkedin.com/profile/view?id=18644639 Best regards Lars Nielsen Make a real classed object that you pass to various objects that need it. Otherwise you make your life

Re: [PHP] static Logging class?

2013-03-03 Thread Ravi Gehlot
Hello Larry, Thanks for sharing! - [image: logo] *Ravi Gehlot * Mobile: 407-283-5282 Orlando, FL 32765-8085 http://www.RaviGehlot.Net/ https://github.com/ravigehlot *First, solve the problem. Then, write the code.* [image: Twitter]