#NEWLINE# def test_categories( handler , framework ) : #NEWLINE# #INDENT# '\n    Calling ``txaio.add_log_categories`` with a dict mapping category keys to\n    category log formats will allow log messages which have the\n    ``log_category`` key take the associated format.\n    ' #NEWLINE# logger = txaio . make_logger ( ) #NEWLINE# txaio . add_log_categories ( { #NEWLINE# #INDENT# 'TX100' : '{adjective} {nouns[2]}' , #NEWLINE# #UNINDENT# } ) #NEWLINE# logger . critical ( "you won't see me" , log_category = 'TX100' , adjective = 'hilarious' , nouns = [ 'skunk' , 'elephant' , 'wombat' ] ) #NEWLINE# assert ( len ( logger . messages ) == 1 ) #NEWLINE# assert handler . messages [ 0 ] . endswith ( b'hilarious wombat' )