<s> import traceback <EOL> import fluent . event <EOL> import fluent . sender <EOL> def simulate_error ( ) : <EOL> fluent . sender . setup ( '<STR_LIT>' , host = '<STR_LIT:localhost>' , port = <NUM_LIT> ) <EOL> def report ( ex ) : <EOL> data = { } <EOL> data [ '<STR_LIT:message>' ] = '<STR_LIT>' . format ( ex ) <EOL> data [ '<STR_LIT>' ] = { '<STR_LIT>' : '<STR_LIT>' } <EOL> fluent . event . Event ( '<STR_LIT>' , data ) <EOL> try : <EOL> raise NameError <EOL> except Exception : <EOL> report ( traceback . format_exc ( ) ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> simulate_error ( ) </s>
