/**
 * @file log_utils.c
 * @brief Multibuild's logging-related utils implementation
 * @author Iaroslav Makarchuk (i.makarchuk@samsung.com)
 * @date Created Dec 20, 2016
 * @par In Samsung Ukraine R&D Center (SURC) under a contract between
 * @par LLC "Samsung Electronics Ukraine Company" (Kiev, Ukraine) and
 * @par "Samsung Elecrtronics Co", Ltd (Seoul, Republic of Korea)
 * @par Copyright: (c) Samsung Electronics Co, Ltd 2015. All rights reserved.
 *
 * This software is proprietary of Samsung Electronics.
 * No part of this software, either material or conceptual may be copied
 * or distributed, transmitted, transcribed, stored in a retrieval system
 * or translated into any human or computer language in any form by any means,
 * electronic, mechanical, manual or otherwise, or disclosed to third parties
 * without the express written permission of Samsung Electronics.
 */

#include <log_utils.h>

const char *LogUtilsGetTag(TEES_LogLevel level) {
  static const char tag_non[] = "[NON]";
  static const char tag_def[] = "[DEF]";
  static const char tag_vbs[] = "[VBS]";
  static const char tag_dbg[] = "[DBG]";
  static const char tag_inf[] = "[INF]";
  static const char tag_wrn[] = "[WRN]";
  static const char tag_err[] = "[ERR]";
  static const char tag_crt[] = "[CRT]";

  switch (level) {
    case TEES_LOG_LEVEL_DEFAULT: return tag_def;
    case TEES_LOG_LEVEL_VERBOSE: return tag_vbs;
    case TEES_LOG_LEVEL_DEBUG: return tag_dbg;
    case TEES_LOG_LEVEL_INFO: return tag_inf;
    case TEES_LOG_LEVEL_WARNING: return tag_wrn;
    case TEES_LOG_LEVEL_ERROR: return tag_err;
    case TEES_LOG_LEVEL_CRITICAL: return tag_crt;
    default: return tag_non;
  }
}

