/*
 * ndsDebug.cpp
 *
 *  Created on: 5. sep. 2012
 *      Author: Viacheslav Isaev
 */

#include <errlog.h>
#include "utsDebug.h"

const char* strDebugLevels[] = {"???", "CRT", "ERR", "WRN", "INF", "DBG", "TRC", "STK"};

const errlogSevEnum iocDebugLevels[] =
 {
		 errlogInfo,
		 errlogFatal,
		 errlogMajor,
		 errlogMinor,
		 errlogInfo,
		 errlogInfo,
		 errlogInfo,
		 errlogInfo
 };


uts::StackLoger::StackLoger(const std::string msg, const std::string file, int line):
	_msg(msg)
	,_file(file)
	,_line(line)
{
	//NDS_LOG(LEVEL, file, line, type, args...)
	//UTS_LOG_EXPAND(UTS_LVL_STACK, "Entering: ", _msg);
	UTS_LOG(UTS_LVL_STACK, _file.c_str(), _line, 0, "Entering: %s", _msg.c_str());
}

uts::StackLoger::~StackLoger()
{
	//UTS_LOG_EXPAND(UTS_LVL_STACK, "Leaving: ", _msg, _file);
	UTS_LOG(UTS_LVL_STACK, _file.c_str(), _line, 0, "Leaving: %s", _msg.c_str());
}
