22# See LICENSE.txt for complete terms. 
33
44import  json 
5+ import  logging 
56import  unittest 
67
78from  mixbox .binding_utils  import  ExternalEncoding 
89from  mixbox .vendor  import  six 
910
1011from  cybox  import  Entity , EntityList , TypedField 
11- import  cybox .bindings .cybox_core  as  core_binding 
12- from  cybox .core  import  Observables 
1312import  cybox .utils 
1413
14+ logger  =  logging .getLogger (__name__ )
15+ 
1516
1617def  assert_equal_ignore (item1 , item2 , ignore_keys = None ):
1718    """Recursively compare two dictionaries, ignoring differences in some keys. 
@@ -54,8 +55,8 @@ def round_trip(o, output=False, list_=False):
5455
5556    klass  =  o .__class__ 
5657    if  output :
57-         print ("Class: "  ,  klass )
58-         print ("-"  *  40 )
58+         logger . debug ("Class: {0}"  . format ( klass ) )
59+         logger . debug ("-"  *  40 )
5960
6061    # 1. cybox.Entity -> dict/list 
6162    if  list_ :
@@ -67,8 +68,8 @@ def round_trip(o, output=False, list_=False):
6768    json_string  =  json .dumps (d )
6869
6970    if  output :
70-         print (json_string )
71-         print ("-"  *  40 )
71+         logger . debug (json_string )
72+         logger . debug ("-"  *  40 )
7273
7374    # Before parsing the JSON, make sure the cache is clear 
7475    cybox .utils .cache_clear ()
@@ -94,8 +95,8 @@ def round_trip(o, output=False, list_=False):
9495        xml_string  =  xml_string .decode (ExternalEncoding )
9596
9697    if  output :
97-         print (xml_string )
98-         print ("-"  *  40 )
98+         logger . debug (xml_string )
99+         logger . debug ("-"  *  40 )
99100
100101    # Before parsing the XML, make sure the cache is clear 
101102    cybox .utils .cache_clear ()
0 commit comments