#NEWLINE# def parse_item( self , item ) : #NEWLINE# #INDENT# '\n        :param item: str, json-encoded string\n        ' #NEWLINE# item = item . decode ( 'utf-8' ) #NEWLINE# try : #NEWLINE# #INDENT# parsed_item = json . loads ( item ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# parsed_item = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . _parsed_logs . append ( parsed_item ) #NEWLINE# #UNINDENT# if isinstance ( parsed_item , dict ) : #NEWLINE# #INDENT# line = parsed_item . get ( 'stream' , '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# parsed_item = None #NEWLINE# line = item #NEWLINE# #UNINDENT# for l in line . splitlines ( ) : #NEWLINE# #INDENT# l = l . strip ( ) #NEWLINE# if l : #NEWLINE# #INDENT# logger . debug ( l ) #NEWLINE# #UNINDENT# #UNINDENT# self . _logs . append ( item ) #NEWLINE# if ( parsed_item is not None ) : #NEWLINE# #INDENT# self . _error = parsed_item . get ( 'error' , None ) #NEWLINE# self . _error_detail = parsed_item . get ( 'errorDetail' , None ) #NEWLINE# if self . _error : #NEWLINE# #INDENT# logger . error ( item . strip ( ) )