diff options
author | davidcunado-arm <david.cunado@arm.com> | 2017-09-18 12:17:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-18 12:17:33 +0100 |
commit | b4f4a2f06ce4da2b7856abb71ad38e726aa7ec68 (patch) | |
tree | f1e70250154010f18994c4d1ea68ce0c133bd722 /plat | |
parent | 756f9bb86ea71b5816da53e4a40ee6e3fe9e5625 (diff) | |
parent | 7f56e9a31c91099cd0147883a0282ec89ae0b346 (diff) | |
download | platform_external_arm-trusted-firmware-b4f4a2f06ce4da2b7856abb71ad38e726aa7ec68.tar.gz platform_external_arm-trusted-firmware-b4f4a2f06ce4da2b7856abb71ad38e726aa7ec68.tar.bz2 platform_external_arm-trusted-firmware-b4f4a2f06ce4da2b7856abb71ad38e726aa7ec68.zip |
Merge pull request #1093 from soby-mathew/eb/log_fw
Implement log framework
Diffstat (limited to 'plat')
-rw-r--r-- | plat/common/plat_log_common.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/plat/common/plat_log_common.c b/plat/common/plat_log_common.c new file mode 100644 index 000000000..30dcb1219 --- /dev/null +++ b/plat/common/plat_log_common.c @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#include <assert.h> +#include <debug.h> +#include <platform.h> + +/* Allow platforms to override the log prefix string */ +#pragma weak plat_log_get_prefix + +static const char *prefix_str[] = { + "ERROR: ", "NOTICE: ", "WARNING: ", "INFO: ", "VERBOSE: "}; + +const char *plat_log_get_prefix(unsigned int log_level) +{ + if (log_level < LOG_LEVEL_ERROR) + log_level = LOG_LEVEL_ERROR; + else if (log_level > LOG_LEVEL_VERBOSE) + log_level = LOG_LEVEL_VERBOSE; + + return prefix_str[(log_level/10) - 1]; +} |