This is not a good solution to the problem at all.
If there are bugs in the code write
test cases to wean them out.
Replicating lines of code is the same as copy paste programming which smells of bad design which is why code generators are bad.
Logging is already solved by the many popular logging frameworks in existence many of which allow you to change the logging settings without restarting the application. If you have a bug then logging in many methods of many classes is not going to help. You need logging only in the methods that are executed before the bug. Logging at the start of methods won't help either and what
you should log to find out the problem depends on the context of the bug. Often you'll want to have a log statement inside an if or a while logging the right variables that expose the problem, so random log statements at the start of methods is not going to cut it.