<s> """<STR_LIT>""" <EOL> from inspect import getmodule , stack <EOL> from eliot import Message <EOL> _ERROR_TOKEN = u'<STR_LIT>' <EOL> def _compute_message_type ( frame_tuple ) : <EOL> """<STR_LIT>""" <EOL> frame , _ , line , func , _ , _ = frame_tuple <EOL> return u'<STR_LIT::>' . join ( [ getmodule ( frame ) . __name__ , func , unicode ( line ) ] ) <EOL> def log_info ( ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> Message . log ( <EOL> message_type = _compute_message_type ( stack ( ) [ <NUM_LIT:1> ] ) , <EOL> ** kwargs <EOL> ) <EOL> def log_error ( ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> Message . log ( <EOL> message_type = _compute_message_type ( stack ( ) [ <NUM_LIT:1> ] ) , <EOL> level = _ERROR_TOKEN , <EOL> ** kwargs <EOL> ) <EOL> def is_error ( message ) : <EOL> """<STR_LIT>""" <EOL> return message . get ( '<STR_LIT>' ) == _ERROR_TOKEN </s>
