4 * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5 * See included license file for license details.
11 #include "smart_ptr.h"
13 // init global logger to null
14 Logger * Log::s_logger = NULL;
16 void Logger::log(const char * fmt, ...)
20 log(m_level, fmt, args);
24 void Logger::log(log_level_t level, const char * fmt, ...)
28 log(level, fmt, args);
32 void Logger::log(const char * fmt, va_list args)
34 log(m_level, fmt, args);
37 //! Allocates a temporary 1KB buffer which is used to hold the
39 void Logger::log(log_level_t level, const char * fmt, va_list args)
41 smart_array_ptr<char> buffer = new char[1024];
42 vsprintf(buffer, fmt, args);
43 if (level <= m_filter)
49 void Log::log(const char * fmt, ...)
55 s_logger->log(fmt, args);
60 void Log::log(const std::string & msg)
68 void Log::log(Logger::log_level_t level, const char * fmt, ...)
74 s_logger->log(level, fmt, args);
79 void Log::log(Logger::log_level_t level, const std::string & msg)
83 s_logger->log(level, msg);
87 void StdoutLogger::_log(const char * msg)