zephyr/scripts/logging/dictionary/dictionary_parser/__init__.py
Daniel Leung caca548cf9 scripts: logging/dictionary: extract actual strings for db
This changes the database generation to actually extracting
individual strings instead of stuffing the whole binary sections
into the database. This allows the generation script to be
extended to accommodate more output formats.

Note that if CONFIG_LOG2_FMT_SECTION is enabled, the format
strings are in log_strings_sections, and also have associated
debug symbols in DWARF. So there is no need to manually
extract them.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2022-04-01 13:29:45 +02:00

23 lines
440 B
Python

#!/usr/bin/env python3
#
# Copyright (c) 2021 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
"""
Dictionary-based Logging Parser Module
"""
from .log_parser_v1 import LogParserV1
def get_parser(database):
"""Get the parser object based on database"""
db_ver = int(database.get_version())
# DB version 1 and 2 correspond to v1 parser
if db_ver in [1, 2]:
return LogParserV1(database)
return None