1#!/usr/bin/env python3 2# 3# Copyright (c) 2021 Intel Corporation 4# 5# SPDX-License-Identifier: Apache-2.0 6 7""" 8Dictionary-based Logging Parser Module 9""" 10 11from .log_parser_v1 import LogParserV1 12 13 14def get_parser(database): 15 """Get the parser object based on database""" 16 db_ver = int(database.get_version()) 17 18 # DB version 1 and 2 correspond to v1 parser 19 if db_ver in [1, 2]: 20 return LogParserV1(database) 21 22 return None 23