in reply to Templatize Repeated code

If you are asking for a way to reduce those two lines of code to something really short, my first reaction would be "don't bother -- those two lines are not so very much to add, and their purpose and effect are clear." I honestly don't think you would gain much by reducing it to something else.

Of course, it would be handy for the "new()" method in the logging module to support a third parameter, allowing the "add('Header')" operation to be done as part of the object creation. Assuming it's an in-house module, that would be the approach that makes the most sense.