//////////////////////////////////////////////////
//Title    : pub_log.h
//Auhtor   : Liu Wei
//Desc     : public log function header
//Created  : 2007-05-21
//Revision :
//
//Revision :
//
//////////////////////////////////////////////////


#ifndef _PUB_LOG_H_
#define _PUB_LOG_H_

#include "public.h"
#include "includes.h"
#include "pub_base.h"
#include "pub_debug.h"
#include "pub_fmt.h"
#include <stdarg.h>

#define RESET           0                    
#define BRIGHT          1
#define DIM             2
#define UNDERLINE       3
#define BLINK           4
#define REVERSE         7
#define HIDDEN          8
#define BLACK           0
#define RED             1 
#define GREEN           2
#define YELLOW          3
#define BLUE            4
#define MAGENTA         5
#define CYAN            6
#define WHITE           7


/////////////////////////////////////////////////////////////////////////
// Public print information
/////////////////////////////////////////////////////////////////////////

#define PIF_INFO	 0x01		// Normal Information  
#define PIF_WARN	 0x02		// Warnings  
#define PIF_GERR	 0x04		// General errors  
#define PIF_CERR	 0x10		// Critical errors  
#define PIF_DBG		 0x20		// Debugging  
#define PIF_UNKN	 0x40		// Things that are unknown  

// Default SIM output 
#define PIF_DEFAULT	 (PIF_INFO|PIF_WARN|PIF_CERR)  	
// Everything, but DBG  				  
#define PIF_ALL		 (PIF_INFO|PIF_WARN|PIF_GERR|PIF_CERR|PIF_UNKN)

#define SYSERR strerror(errno)

extern char *ByteBinToStr( char *pDst , const u8 *pSrc , int nByte );
extern char *TxtColor ( int nAttr, int nFg, int nBg, char *pStr );
extern int MsgToFmtLog ( const BYTE * pBcd, int nBcdLen, char *pStr, int nStrBuffSize );

#ifdef DEBUG 
#define WxcDebugLog printf
#else
#define WxcDebugLog
#endif

#endif 
