23 #define ANSI_GREEN "\033[32m"
24 #define ANSI_RED "\033[31m"
25 #define ANSI_BLUE "\033[34m"
26 #define ANSI_YELLOW "\033[33m"
27 #define ANSI_MAGENTA "\033[35m"
28 #define ANSI_CYAN "\033[36m"
29 #define ANSI_BOLD "\033[1m"
30 #define ANSI_ITALIC "\033[3m"
31 #define ANSI_UNDERLINE "\033[4m"
32 #define ANSI_REVERSE "\033[7m"
33 #define ANSI_RESET "\033[0m"
39 #define RTS_LOG_PORT_RTS 8000
40 #define RTS_LOG_PORT_TEST 8001
41 #define RTS_LOG_PORT_DAQ 8002
42 #define RTS_LOG_PORT_TRG 8003
43 #define RTS_LOG_PORT_EVP 8004
44 #define RTS_LOG_PORT_READER 8005
45 #define RTS_LOG_PORT_TPX 8006
46 #define RTS_LOG_PORT_DB 8007
47 #define RTS_LOG_PORT_ESB 8008
48 #define RTS_LOG_PORT_L3 8009
49 #define RTS_LOG_PORT_DET 8010
50 #define RTS_LOG_PORT_EMAIL 8013
51 #define RTS_LOG_PORT_DCS 8014
52 #define RTS_LOG_PORT_ITPC 8015
53 #define RTS_LOG_PORT_FWD 8016
55 #define RTS_LOG_PORT RTS_LOG_PORT_TEST
59 #define RTS_LOG_HOST RTS_DAQMAN
61 #define RTS_LOG_HOST "130.199.60.86"
66 #define RTS_LOG_STDERR 2
67 #define RTS_LOG_FILE 4
70 void rtsLogAddJmlFile (
char *fname);
73 #define CRIT "CRITICAL"
74 #define OPER "OPERATOR"
76 #define WARN "WARNING"
82 #define CAUTION "CAUTION"
86 #define U_TONKO "U_TONKO"
87 #define U_JEFF "U_JEFF"
91 #define SAVEme "SAVEme"
95 #ifndef RTS_ENABLE_LOG
96 #define RTS_ASSERT(expr) assert(expr)
97 #define LOG(SEV,STRING,ARGS...)
101 #define INLINE_HACK extern __inline__
103 #define INLINE_HACK inline
109 extern volatile int tonkoLogLevel ;
111 extern int rtsLogAddDest(
const char *server,
int port) ;
114 INLINE_HACK
void rtsLogLevelInt(
int level)
116 tonkoLogLevel = level;
121 INLINE_HACK
void rtsLogLevel(
const char *level)
123 switch((
int) *level) {
157 #define RTS_ASSERT(expr)
161 extern int sbLoggerStart(
void) ;
162 extern int sbLOG(
char *str,
unsigned int a1,
unsigned int a2,
163 unsigned int a3,
unsigned int a4,
unsigned int a5,
unsigned int a6) ;
164 extern int sbLoggerRemoveDesc(
int desc) ;
165 extern int sbLoggerAddDesc(
int desc) ;
167 #define sbLOG(args...)
170 #ifdef RTS_ENABLE_LOG
171 #define LOG(SEV,STRING,A1,A2,A3,A4,A5) \
173 const char *const yada = SEV ; \
174 if((tonkoLogLevel>0) && (*yada == 'D')) ; \
175 else if((tonkoLogLevel>1) && (*yada == 'N')) ; \
176 else if((tonkoLogLevel>2) && (*yada == 'W')) ; \
177 else if((tonkoLogLevel>3) && (*yada == 'E')) ; \
178 else if((tonkoLogLevel>4) && (*yada == 'O')) ; \
180 logMsg((char *)"" SEV ": " __FILE__ " [line %d]: " STRING "\n",__LINE__,(unsigned int)A1,(unsigned int)A2,(unsigned int)A3,(unsigned int)A4,(unsigned int)A5) ; \
181 sbLOG((char *)"" SEV ": " __FILE__ " [line %d]: " STRING "\n",__LINE__,(unsigned int)A1,(unsigned int)A2,(unsigned int)A3,(unsigned int)A4,(unsigned int)A5) ; \
185 #endif // RTS_ENABLE_LOG
187 #define rtsLogOutput(x)
191 #ifdef RTS_ENABLE_LOG
192 #define RTS_ASSERT(expr) LOG(CRIT,"assert(%s) true -- certain death follows",__STRING(expr))
194 extern int rtsLogUnix_v(
const char *str, ...) ;
196 extern int rtsLogOutput(
int flag) ;
198 extern void rtsLogAddCmd(
const char *cmd) ;
200 extern int rtsLogAddFile(
char *fname) ;
202 #ifdef RTS_ENABLE_LOG
203 #ifdef RTS_LOG_COLORED
205 #define LOG(SEV,STRING,ARGS...) \
207 const char *const yada = SEV ; \
208 if((tonkoLogLevel>0) && (*yada == 'D')) ; \
209 else if((tonkoLogLevel>1) && (*yada == 'N')) ; \
210 else if((tonkoLogLevel>2) && (*yada == 'W')) ; \
211 else if((tonkoLogLevel>3) && (*yada == 'E')) ; \
212 else if((tonkoLogLevel>4) && (*yada == 'O')) ; \
214 rtsLogUnix_v("COLOR" SEV ": " __FILE__ " [line %d]: " STRING "\n" , __LINE__ , ##ARGS) ;\
219 #define LOG(SEV,STRING,ARGS...) \
221 const char *const yada = SEV ; \
222 if((tonkoLogLevel>0) && (*yada == 'D')) ; \
223 else if((tonkoLogLevel>1) && (*yada == 'N')) ; \
224 else if((tonkoLogLevel>2) && (*yada == 'W')) ; \
225 else if((tonkoLogLevel>3) && (*yada == 'E')) ; \
226 else if((tonkoLogLevel>4) && (*yada == 'O')) ; \
228 rtsLogUnix_v("" SEV ": " __FILE__ " [line %d]: " STRING "\n" , __LINE__ , ##ARGS) ;\