Browse Source
No functional changes. Change-Id: I850f08718abb69d5d58856b0e3de036266d8c2f4 Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>pull/1546/head
Antonio Nino Diaz
6 years ago
3 changed files with 31 additions and 25 deletions
@ -1,25 +1,28 @@ |
|||
/*
|
|||
* Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. |
|||
* Copyright (c) 2017-2018, 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[] = { |
|||
static const char *plat_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; |
|||
unsigned int level; |
|||
|
|||
return prefix_str[(log_level/10) - 1]; |
|||
if (log_level < LOG_LEVEL_ERROR) { |
|||
level = LOG_LEVEL_ERROR; |
|||
} else if (log_level > LOG_LEVEL_VERBOSE) { |
|||
level = LOG_LEVEL_VERBOSE; |
|||
} else { |
|||
level = log_level; |
|||
} |
|||
|
|||
return plat_prefix_str[(level / 10U) - 1U]; |
|||
} |
|||
|
Loading…
Reference in new issue