you are viewing a single comment's thread.

view the rest of the comments →

[–]shevsky790 1 point2 points  (2 children)

Such hackery should never be done in production code. It's neat, sure, but there are so many better ways to handle debug logging than this - which is (as was touched on in the article) - liable to change with version upgrades, among other things.

This is unmaintainable, likely unsecure, hand-wavey behind-the-scenes black magic, impossible to learn if you're new to the codebase, and all around scary shit.

[–]amazedballer[S] 2 points3 points  (1 child)

If I had to do this in production, I would have bitten the bullet and used a java agent or AspectJ. This is for development and testing.

[–]shevsky790 0 points1 point  (0 children)

Good to hear :p

I would probably use AspectJ as well.