1 /* 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 14 static const char *prefix_str[] = { 15 "ERROR: ", "NOTICE: ", "WARNING: ", "INFO: ", "VERBOSE: "}; 16 plat_log_get_prefix(unsigned int log_level)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 } 26