File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
boards/xtensa/up_squared_adsp/tools/lib Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def read_bytes(buffer):
16
16
class Loglist :
17
17
"""Loglist class"""
18
18
19
- def __init__ (self , argument ):
19
+ def __init__ (self , argument , debug = False ):
20
20
"""Constructor for the loglist takes argument filename or buffer"""
21
21
22
22
if isinstance (argument , str ):
@@ -29,13 +29,14 @@ def __init__(self, argument):
29
29
30
30
self .loglist = []
31
31
self .parse ()
32
+ self .debug = debug
32
33
33
34
def parse_slot (self , slot ):
34
35
magic = read_bytes (slot [0 :2 ])
35
36
36
37
if magic == MAGIC :
37
38
id_num = read_bytes (slot [2 :4 ])
38
- logstr = slot [4 :].decode (errors = 'replace' ). split ( ' \r ' , 1 )[ 0 ]
39
+ logstr = slot [4 :].decode (errors = 'replace' )
39
40
self .loglist .append ((id_num , logstr ))
40
41
41
42
def parse (self ):
@@ -45,4 +46,8 @@ def parse(self):
45
46
46
47
def print (self ):
47
48
for pair in sorted (self .loglist ):
48
- print ('{} : {}' .format (* pair ))
49
+ if self .debug :
50
+ # Add slot number when debug is enabled
51
+ print ('[{}] : {}' .format (* pair ), end = '' )
52
+ else :
53
+ print ('{}' .format (pair [1 ]), end = '' )
You can’t perform that action at this time.
0 commit comments