def test_formatTimeCustom(self):
        """
        Time is first field.  Custom formatting function is an optional
        argument.
        """
        formatTime = lambda t: u"__{0}__".format(t)
        event = dict(log_format=u"XYZZY", log_time=12345)
        self.assertEqual(
            formatEventAsClassicLogText(event, formatTime=formatTime),
            u"__12345__ [-\x23-] XYZZY\n",
        )

        Time is first field.  Custom formatting function is an optional
        argument.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/logger/test/test_format.py