Skip to content

Failed to handle empty header #3

@phamquiluan

Description

@phamquiluan

In case the header is empty, the algorithm can't extract the log properly. Please see the attached debug log.

(ins)(Pdb) n
> /ws/LogBatcher/logbatcher/util.py(96)log_to_dataframe()
-> log_contents = []
(ins)(Pdb) 
> /ws/LogBatcher/logbatcher/util.py(97)log_to_dataframe()
-> with open(log_file, 'r') as file:
(ins)(Pdb) 
> /ws/LogBatcher/logbatcher/util.py(98)log_to_dataframe()
-> for line in [next(file) for _ in range(size)]:
(ins)(Pdb) 
> /ws/LogBatcher/logbatcher/util.py(99)log_to_dataframe()
-> try:
(ins)(Pdb) 
> /ws/LogBatcher/logbatcher/util.py(100)log_to_dataframe()
-> match = regex.search(line.strip())
(ins)(Pdb) 
> /ws/LogBatcher/logbatcher/util.py(101)log_to_dataframe()
-> message = [match.group(header) for header in headers]
(ins)(Pdb) 
> /ws/LogBatcher/logbatcher/util.py(102)log_to_dataframe()
-> log_contents.append(message[-1])
(ins)(Pdb) p message
[]
(ins)(Pdb) p line
'GetCartAsync called with userId=f6baa338-17b8-4a60-9256-45e6b42573c9\n'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions