source: cpp/gdk/framsg.cpp @ 104

Last change on this file since 104 was 104, checked in by sz, 11 years ago

introducing object de/serialization - see serialtest.cpp
the core GDK classes can be now used in multiple threads (ifdef MULTITHREADED)

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1#include "framsg.h"
2#include "nonstd_stdio.h"
3
4#ifdef SHP
5#include <FBaseSys.h> //AppLog
6#endif
7
8#ifdef MOBILE2D
9#include <Winbase.h>
10#include "Util.h"
11#endif
12
13char* MSG_LEVEL[]={"DEBUG","INFO","WARN","ERROR","CRITICAL"};
14
15/* TODO integracja z error managerem
16void FramMessage(const char *o,const char *m,const char *bl,int w)
17{
18  const char *lvl=MSG_LEVEL[w+1];
19#ifdef SHP
20  //jesli chcemy zeby nawet w trybie release wysylal komunikaty:
21  //#define AppLog(...)      __App_info(__PRETTY_FUNCTION__ , __LINE__, __VA_ARGS__)
22        AppLog("%s%s::%s - %s\n",lvl,o,m,bl);
23#elif defined MOBILE2D
24        char buf[1000];
25        sprintf(buf,"%s%s::%s - %s\n",lvl,o,m,bl);
26        OutputDebugString(Util::strTOwstr(buf).c_str());
27#else
28        fprintf(w>0?stderr:stdout,"%s%s::%s - %s\n",lvl,o,m,bl);
29#endif
30}
31*/
32
33void FMprintf(const char *o,const char *m,int w,const char *bl, ...)
34{
35   char buf[10000];
36   va_list argptr;
37   va_start(argptr,bl);
38         vsnprintf(buf,10000,bl,argptr);
39         va_end(argptr);
40   FramMessage(o,m,buf,w);
41}
42
43void FMprintf(const char *o,const char *m,int w,const char *bl,va_list va)
44{
45   char buf[10000];
46   vsnprintf(buf,10000,bl,va);
47   FramMessage(o,m,buf,w);
48}
49
50void FMprintf(const char *bl,...)
51{
52        va_list argptr;
53        va_start(argptr,bl);
54        FMprintf("Message","printf",0,bl,argptr);
55        va_end(argptr);
56}
Note: See TracBrowser for help on using the repository browser.