[nio-cvs] r61 - branches/home/psmith/restructure/src/nio-logger

psmith at common-lisp.net psmith at common-lisp.net
Tue Jan 30 06:27:53 UTC 2007


Author: psmith
Date: Tue Jan 30 01:27:51 2007
New Revision: 61

Modified:
   branches/home/psmith/restructure/src/nio-logger/nio-logger.asd
   branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp
   branches/home/psmith/restructure/src/nio-logger/run-logging-client.lisp
   branches/home/psmith/restructure/src/nio-logger/run-logging-server.lisp
Log:
first working logger

Modified: branches/home/psmith/restructure/src/nio-logger/nio-logger.asd
==============================================================================
--- branches/home/psmith/restructure/src/nio-logger/nio-logger.asd	(original)
+++ branches/home/psmith/restructure/src/nio-logger/nio-logger.asd	Tue Jan 30 01:27:51 2007
@@ -8,5 +8,5 @@
 		 (:file "nio-logger" :depends-on ("nio-logger-package"))
 		 )
 
-    :depends-on (:nio-yarpc))
+    :depends-on (:nio-yarpc :nio-utils))
 

Modified: branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp
==============================================================================
--- branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp	(original)
+++ branches/home/psmith/restructure/src/nio-logger/nio-logger.lisp	Tue Jan 30 01:27:51 2007
@@ -39,12 +39,14 @@
     (nio-utils:format-log t "toplevel adding conn ~A to ~A~%" sm ip-address)
     (with-open-file (in filename :direction :input)
       (loop for text = (read-line in nil nil) do
-    	(let ((rpc (format nil "(nio-logger:log +log-file-name+ ~A" text)))
+    	(let ((rpc (format nil "(nio-logger:remote-log \"~A\")" text)))
 	  (nio-utils:format-log t "Toplevel Submitting job~A~%" rpc)
 	  (nio-utils:format-log t "Result of remote-log ~A~%" (nio-yarpc:remote-execute sm rpc)))))))
 
 ;Runs a multithreaded system with an IO thread dealing with IO only and a 'job'  thread taking and executing jobs
 
+(defparameter +log-file-name+ "/tmp/out")
+
 (defun run-logging-server()
   (setf nio-yarpc:+process-jobs-inline+ nil)
   (nio:load-ips "ips.txt")
@@ -53,5 +55,6 @@
     ;;block waiting for jobs
      (nio-yarpc:run-job)))
 
-(nio-yarpc:defremote remote-log(destination control-string &rest format-arguments)
-  (format-log destination control-string format-arguments))
+(nio-yarpc:defremote remote-log(str)
+  (with-open-file (out +log-file-name+ :direction :output :if-exists :append)
+    (nio-utils:format-log out "~A~%" str)))

Modified: branches/home/psmith/restructure/src/nio-logger/run-logging-client.lisp
==============================================================================
--- branches/home/psmith/restructure/src/nio-logger/run-logging-client.lisp	(original)
+++ branches/home/psmith/restructure/src/nio-logger/run-logging-client.lisp	Tue Jan 30 01:27:51 2007
@@ -27,5 +27,5 @@
 
 (push :nio-debug *features*)
 (require :asdf)
-(require :nio-yarpc)
-(nio-logger:tail-log)
+(require :nio-logger)
+(nio-logger:tail-log "/tmp/test" "127.0.0.1")

Modified: branches/home/psmith/restructure/src/nio-logger/run-logging-server.lisp
==============================================================================
--- branches/home/psmith/restructure/src/nio-logger/run-logging-server.lisp	(original)
+++ branches/home/psmith/restructure/src/nio-logger/run-logging-server.lisp	Tue Jan 30 01:27:51 2007
@@ -27,5 +27,5 @@
 
 (push :nio-debug *features*)
 (require :asdf)
-(require :nio-yarpc)
+(require :nio-logger)
 (nio-logger:run-logging-server)



More information about the Nio-cvs mailing list