blob: 30dcb121936aecd98f64a878325d0fb52b0a5e9e [file] [log] [blame]
Soby Mathewaaf15f52017-09-04 11:49:29 +01001/*
2 * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <assert.h>
8#include <debug.h>
9#include <platform.h>
10
11/* Allow platforms to override the log prefix string */
12#pragma weak plat_log_get_prefix
13
14static const char *prefix_str[] = {
15 "ERROR: ", "NOTICE: ", "WARNING: ", "INFO: ", "VERBOSE: "};
16
17const char *plat_log_get_prefix(unsigned int log_level)
18{
19 if (log_level < LOG_LEVEL_ERROR)
20 log_level = LOG_LEVEL_ERROR;
21 else if (log_level > LOG_LEVEL_VERBOSE)
22 log_level = LOG_LEVEL_VERBOSE;
23
24 return prefix_str[(log_level/10) - 1];
25}