LogMeister icon indicating copy to clipboard operation
LogMeister copied to clipboard

A bit DRYer

Open devboy opened this issue 14 years ago • 5 comments

Just saw this and thought I make a quick change. Not tested, just wrote it in TextMate without compiling.

devboy avatar Apr 09 '11 22:04 devboy

I would also propose to remove the different sendThis sendThat functions in the connectors and use a function that takes for example a LogType.WARN or LogType.INFO as a parameter.

devboy avatar Apr 09 '11 22:04 devboy

Hi,

Thanks for the pull request, i like your change but i think it makes the code harder to read.. don't you agree? But I think most people use the .swc anyways..

What do you mean with the second comment?

jankeesvw avatar Apr 10 '11 18:04 jankeesvw

I think you could shrink down all your connector classes and maybe others to just a few lines of code, by removing all the code that is basically copy & paste. And introducing MessageType in some sort, would make the code more readable yet smaller and DRYer. imho.

devboy avatar Apr 10 '11 18:04 devboy

Additonaly I saw that there is no need to extend the AbstractConnector. I would rather use it in a compositional sense than an abstract.

devboy avatar Apr 10 '11 19:04 devboy

I totally agree with you, but the code needs to be really readable :-)

The AbstractConnector is pretty lame, a static function to get the sender would be enough!

jankeesvw avatar Apr 11 '11 08:04 jankeesvw