]> mj.ucw.cz Git - libucw.git/commitdiff
Libucw: Replace obsolete log calls by msg.
authorMichal Vaner <vorner@ucw.cz>
Mon, 21 Jul 2008 20:05:57 +0000 (22:05 +0200)
committerMartin Mares <mj@ucw.cz>
Tue, 22 Jul 2008 16:28:13 +0000 (18:28 +0200)
ucw/kmp-test.c
ucw/lfs-test.c
ucw/log-file.c
ucw/mainloop.c
ucw/runcmd.c
ucw/threads.c
ucw/workqueue.c

index 4e8e3ca88255a617e19d8f0d609149564b93f3ed..92b91c762742de87d825c0de05bcc070863ca604 100644 (file)
@@ -9,7 +9,7 @@
 #include <string.h>
 
 #if 0
-#define TRACE(x...) do{log(L_DEBUG, x);}while(0)
+#define TRACE(x...) do{msg(L_DEBUG, x);}while(0)
 #else
 #define TRACE(x...) do{}while(0)
 #endif
index 07596cbd9cb2874d020f8028a1192d52876679f0..8ef657d7f0f1eb7725cb0173c5802dd27e228421 100644 (file)
@@ -25,7 +25,7 @@ int main(void)
        if (!b)
                die("Cannot create large-file");
 
-       log(L_DEBUG, "Writing %d blocks of size %d", COUNT, BLOCK);
+       msg(L_DEBUG, "Writing %d blocks of size %d", COUNT, BLOCK);
        for (i=0; i<COUNT; i++)
        {
                memset(block, i & 0xff, BLOCK);
@@ -41,7 +41,7 @@ int main(void)
        if (!b)
                die("Cannot create large-file");
 #endif
-       log(L_DEBUG, "Checking the file contents in %d tests", TESTS);
+       msg(L_DEBUG, "Checking the file contents in %d tests", TESTS);
        for (i=0; i<TESTS; i++)
        {
                uns idx = random()%COUNT;
@@ -56,7 +56,7 @@ int main(void)
                        fflush(stdout);
                }
        }
-       log(L_DEBUG, "Done");
+       msg(L_DEBUG, "Done");
 
        bclose(b);
        return 0;
index 6ac07823894f23a324eb80dec9e2906b0d0f9055..ec05396c3dead9fad243308252d1f15927109fae 100644 (file)
@@ -114,7 +114,7 @@ int main(int argc, char **argv)
   log_init(argv[0]);
   log_file("/proc/self/fd/1");
   for (int i=1; i<argc; i++)
-    log(L_INFO, argv[i]);
+    msg(L_INFO, argv[i]);
   return 0;
 }
 
index 4c8e2cd43bd3835330c81f8a7881f6de4d9f45ca..fc5beff7cabeaa8a55cf3be64924aca2b6960498 100644 (file)
@@ -462,50 +462,50 @@ static void dread(struct main_file *fi)
 {
   if (fi->rpos < fi->rlen)
     {
-      log(L_INFO, "Read EOF");
+      msg(L_INFO, "Read EOF");
       file_del(fi);
     }
   else
     {
-      log(L_INFO, "Read done");
+      msg(L_INFO, "Read done");
       file_read(fi, rb, sizeof(rb));
     }
 }
 
 static void derror(struct main_file *fi, int cause)
 {
-  log(L_INFO, "Error: %m !!! (cause %d)", cause);
+  msg(L_INFO, "Error: %m !!! (cause %d)", cause);
   file_del(fi);
 }
 
 static void dwrite(struct main_file *fi UNUSED)
 {
-  log(L_INFO, "Write done");
+  msg(L_INFO, "Write done");
 }
 
 static int dhook(struct main_hook *ho UNUSED)
 {
-  log(L_INFO, "Hook called");
+  msg(L_INFO, "Hook called");
   return 0;
 }
 
 static void dtimer(struct main_timer *tm)
 {
-  log(L_INFO, "Timer tick");
+  msg(L_INFO, "Timer tick");
   timer_add(tm, main_now + 10000);
 }
 
 static void dentry(void)
 {
-  log(L_INFO, "*** SUBPROCESS START ***");
+  msg(L_INFO, "*** SUBPROCESS START ***");
   sleep(2);
-  log(L_INFO, "*** SUBPROCESS FINISH ***");
+  msg(L_INFO, "*** SUBPROCESS FINISH ***");
   exit(0);
 }
 
 static void dexit(struct main_process *pr)
 {
-  log(L_INFO, "Subprocess %d exited with status %x", pr->pid, pr->status);
+  msg(L_INFO, "Subprocess %d exited with status %x", pr->pid, pr->status);
 }
 
 int
@@ -539,7 +539,7 @@ main(void)
   main_debug();
 
   main_loop();
-  log(L_INFO, "Finished.");
+  msg(L_INFO, "Finished.");
 }
 
 #endif
index 9ea0a1a31001f3983be16f2737d0805d8e9ae43a..9670187df38069f3d4005b3c5f054323dcc80ac9 100644 (file)
@@ -126,7 +126,7 @@ int main(void)
 {
   char msg[1024];
   echo_command(msg, sizeof(msg), "/bin/echo", "datel", "strakapoud", NULL);
-  log(L_INFO, "Running <%s>", msg);
+  msg(L_INFO, "Running <%s>", msg);
   run_command("/bin/echo", "datel", "strakapoud", NULL);
   return 0;
 }
index ec839f8c0086a352f36be5de81d7a9b76d50156c..1260e8759ae1a3b0ee96303e850c752bba6ec3eb 100644 (file)
@@ -116,7 +116,7 @@ int main(void)
 {
   ucwlib_lock();
   ucwlib_unlock();
-  log(L_INFO, "tid=%d", ucwlib_thread_context()->thread_id);
+  msg(L_INFO, "tid=%d", ucwlib_thread_context()->thread_id);
   return 0;
 }
 
index 314177b8757ca45445894742a24a4b4355d0a490..83f81def5566ac5301360c887c630e93792429ce 100644 (file)
@@ -229,12 +229,12 @@ work_try_wait(struct work_queue *q)
 
 static void wt_init(struct worker_thread *t)
 {
-  log(L_INFO, "INIT %d", t->id);
+  msg(L_INFO, "INIT %d", t->id);
 }
 
 static void wt_cleanup(struct worker_thread *t)
 {
-  log(L_INFO, "CLEANUP %d", t->id);
+  msg(L_INFO, "CLEANUP %d", t->id);
 }
 
 struct w {
@@ -244,7 +244,7 @@ struct w {
 
 static void go(struct worker_thread *t, struct work *w)
 {
-  log(L_INFO, "GO %d: request %d (pri %d)", t->id, ((struct w *)w)->id, w->priority);
+  msg(L_INFO, "GO %d: request %d (pri %d)", t->id, ((struct w *)w)->id, w->priority);
   usleep(1);
 }
 
@@ -267,12 +267,12 @@ int main(void)
       w->w.priority = (i < 250 ? i : 0);
       w->id = i;
       work_submit(&q, &w->w);
-      log(L_INFO, "Submitted request %d (pri %d)", w->id, w->w.priority);
+      msg(L_INFO, "Submitted request %d (pri %d)", w->id, w->w.priority);
     }
 
   struct w *w;
   while (w = (struct w *) work_wait(&q))
-    log(L_INFO, "Finished request %d", w->id);
+    msg(L_INFO, "Finished request %d", w->id);
 
   work_queue_cleanup(&q);
   worker_pool_cleanup(&pool);