Changeset 372 for cpp/common/hmessage.cpp
- Timestamp:
- 04/22/15 04:14:59 (10 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/hmessage.cpp
r371 r372 3 3 // See LICENSE.txt for details. 4 4 5 #include " framsg.h"5 #include "hmessage.h" 6 6 #include <common/nonstd_stdio.h> 7 7 #include "stl-util.h" 8 8 #include "Convert.h" 9 9 10 const char* MSG_LEVEL[]={"[DEBUG] ","","[WARN] ","[ERROR] ","[CRITICAL] "};10 const char* HMSG_LEVEL[]={"[DEBUG] ","","[WARN] ","[ERROR] ","[CRITICAL] "}; 11 11 12 void FramMessage(const char *o, const char *m, const char *txt, int w)12 void Hmessage(const char *o, const char *m, const char *txt, int w) 13 13 { 14 14 int line = 0; //all lines except the first one get the "..." prefix … … 24 24 { 25 25 if (*nextsep == 0) //there was only one line! no need to modify it in any way. 26 _ FramMessageSingleLine(o, m, txt, w);26 _HmessageSingleLine(o, m, txt, w); 27 27 else //first line from multi-line 28 _ FramMessageSingleLine(o, m, string(txt, nextsep - txt).c_str(), w);28 _HmessageSingleLine(o, m, string(txt, nextsep - txt).c_str(), w); 29 29 } 30 30 else //consecutive lines from multi-line 31 _ FramMessageSingleLine(o, m, (FRAMSG_MULTILINE_CONTINUATION + string(txt, nextsep - txt)).c_str(), w); //could also add line numbers like ...(3)... but let's keep the prefix short and simple31 _HmessageSingleLine(o, m, (HMSG_MULTILINE_CONTINUATION + string(txt, nextsep - txt)).c_str(), w); //could also add line numbers like ...(3)... but let's keep the prefix short and simple 32 32 line++; 33 33 if ((nextsep[0] == '\r') && (nextsep[1] == '\n')) … … 39 39 40 40 41 void FMprintf_va(const char *o,const char *m,int w,const char *bl,va_list va)41 void Hprintf_va(const char *o,const char *m,int w,const char *bl,va_list va) 42 42 { 43 43 string buf=ssprintf_va(bl,va); 44 FramMessage(o,m,buf.c_str(),w);44 Hmessage(o,m,buf.c_str(),w); 45 45 } 46 46 47 void FMprintf(const char *o,const char *m,int w,const char *bl, ...)47 void Hprintf(const char *o,const char *m,int w,const char *bl, ...) 48 48 { 49 49 va_list argptr; 50 50 va_start(argptr,bl); 51 FMprintf_va(o,m,w,bl,argptr);51 Hprintf_va(o,m,w,bl,argptr); 52 52 va_end(argptr); 53 53 } 54 54 55 void print FM(const char *bl,...)55 void printH(const char *bl,...) 56 56 { 57 57 va_list argptr; 58 58 va_start(argptr,bl); 59 FMprintf_va("Message","printf",FMLV_INFO,bl,argptr);59 Hprintf_va("Message","printf",HMLV_INFO,bl,argptr); 60 60 va_end(argptr); 61 61 }
Note: See TracChangeset
for help on using the changeset viewer.