EXE_LD_OPTS = -L $(LIB_DIR) -lxml2 -lopensrf_transport -lopensrf_stack -ljson
CC = gcc
-all: client sys_client
+all: lib
+#client sys_client
-sys_client: sys_client.c lib
- $(CC) $(CC_OPTS) $(EXE_LD_OPTS) *.o sys_client.c -o sys_client
+#sys_client: sys_client.c lib
+# $(CC) $(CC_OPTS) $(EXE_LD_OPTS) *.o sys_client.c -o sys_client
-client: client.c lib
- $(CC) $(CC_OPTS) $(EXE_LD_OPTS) *.o client.c -o client
+#client: client.c lib
+# $(CC) $(CC_OPTS) $(EXE_LD_OPTS) *.o client.c -o client
# ----------------------------------------------------------------
#include "opensrf/generic_utils.h"
#include <stdio.h>
#include "pthread.h"
+#include <sys/timeb.h>
int _init_log();
#define LOG_INFO 3
#define LOG_DEBUG 4
-void get_timestamp( char buf_25chars[]) {
- time_t epoch = time(NULL);
- char* localtime = strdup( ctime( &epoch ) );
- strcpy( buf_25chars, localtime );
- buf_25chars[ strlen(localtime)-1] = '\0'; // remove newline
+void get_timestamp( char buf_36chars[]) {
+
+ struct timeb tb;
+ ftime(&tb);
+ //time_t epoch = time(NULL);
+ char* localtime = strdup( ctime( &(tb.time) ) );
+ char mil[4];
+ memset(mil,0,4);
+ sprintf(mil," (%d)",tb.millitm);
+ strcpy( buf_36chars, localtime );
+ buf_36chars[ strlen(localtime)-1] = '\0'; // remove newline
+ strcat(buf_36chars,mil);
free(localtime);
}
void fatal_handler( char* msg, ... ) {
- char buf[25];
- memset( buf, 0, 25 );
+ char buf[36];
+ memset( buf, 0, 36 );
get_timestamp( buf );
pid_t pid = getpid();
va_list args;
void warning_handler( char* msg, ... ) {
- char buf[25];
- memset( buf, 0, 25 );
+ char buf[36];
+ memset( buf, 0, 36 );
get_timestamp( buf );
pid_t pid = getpid();
va_list args;
void info_handler( char* msg, ... ) {
- char buf[25];
- memset( buf, 0, 25 );
+ char buf[36];
+ memset( buf, 0, 36 );
get_timestamp( buf );
pid_t pid = getpid();
va_list args;
void debug_handler( char* msg, ... ) {
- char buf[25];
- memset( buf, 0, 25 );
+ char buf[36];
+ memset( buf, 0, 36 );
get_timestamp( buf );
pid_t pid = getpid();
va_list args;