Changeset 48 for branches/home/psmith


Ignore:
Timestamp:
01/22/07 03:43:03 (18 years ago)
Author:
psmith
Message:

Tidied up logging

Location:
branches/home/psmith/restructure
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified branches/home/psmith/restructure/run-yarpc-client.lisp

    r44 r48  
    77(sleep 4)
    88(let ((sm (nio:add-connection "127.0.0.1" 16323 'nio-yarpc:yarpc-client-state-machine)))
    9   (format t "~A toplevel adding conn ~A~%" (nio-compat:get-readable-time) sm)
     9  (format-log t "toplevel adding conn ~A~%" sm)
    1010  (loop
    11     (format t "~A toplevel Submitting job~%" (nio-compat:get-readable-time) )
    12     (format t "~A Result of remote-execute ~A~%" (nio-compat:get-readable-time) (nio-yarpc:remote-execute sm "(nio-yarpc:test-rpc-list)"))))
     11    (format-log t "Toplevel Submitting job~%" )
     12    (format-log t "Result of remote-execute ~A~%" (nio-yarpc:remote-execute sm "(nio-yarpc:test-rpc-list)"))))
  • TabularUnified branches/home/psmith/restructure/src/compat/nio-compat-package.lisp

    r44 r48  
    3636             
    3737             ;;utils
    38              get-readable-time
     38             format-log
    3939             ))
  • TabularUnified branches/home/psmith/restructure/src/compat/utils.lisp

    r47 r48  
    5353      (+ universal-base (/ (- current-internal internal-base) internal-time-units-per-second) )))
    5454
    55   (defun get-readable-high-res()
     55  (defun get-readable-high-res-time()
    5656    (let ((estimated-universal-float (get-universal-high-res)))
    5757      (multiple-value-bind (estimated-universal estimated-universal-rem) (floor estimated-universal-float)
     
    5959 
    6060  )
     61
     62;Format the message to destination but prepend a high res time to the message, useful for logging
     63(defmacro format-log (destination control-string &rest format-arguments)
     64  `(format ,destination (concatenate 'string "~A - " ,control-string) (get-readable-high-res-time) ,@format-arguments))
  • TabularUnified branches/home/psmith/restructure/src/io/async-fd.lisp

    r44 r48  
    150150(defun write-more (async-fd)
    151151  "Write data from ASYNC-FD's write bytebuffer"
    152 #+nio-debug (format t "async-fd:write-more - called with ~A~%" async-fd)
     152  (format-log t "async-fd:write-more - called with ~A~%" async-fd)
    153153  (with-slots (write-fd foreign-write-buffer close-pending) async-fd
    154154#+nio-debug  (format t "async-fd:write-more - foreign-write-buffer b4 flip ~A~%" foreign-write-buffer)
  • TabularUnified branches/home/psmith/restructure/src/io/nio-server.lisp

    r44 r48  
    123123                    (t
    124124                     (let ((async-fd (gethash fd client-hash)))
    125 #+nio-debug                    (format t "IO event ~A on ~A~%" event async-fd)
     125                       (format-log t "IO event ~A on ~A~%" event async-fd)
    126126                       (unless (null async-fd)
    127127                         (catch 'error-exit
  • TabularUnified branches/home/psmith/restructure/src/protocol/yarpc/yarpc-state-machine.lisp

    r46 r48  
    6060
    6161(defun run-job(&key (wait-on-job-pdw t))
    62   (format t "~A Server toplevel waiting for job~%" (nio-compat:get-readable-time))
     62  (format-log t "Server toplevel waiting for job~%")
    6363  (destructuring-bind (job result-queue) (nio-compat:take nio-yarpc:job-queue :blocking-call wait-on-job-pdw)
    64     (format t "~A Server received job ~A~%" (nio-compat:get-readable-time) job)
     64    (format-log t "Server received job ~A~%" job)
    6565    (nio-compat:add result-queue (nio-yarpc:execute-call job))))
    6666
    6767
    6868(defmethod process-outgoing-packet((sm yarpc-state-machine))
    69   (format t "yarpc-state-machine: process-outgoing-packet called, polling the results-queue ~%")
     69  (format-log t "yarpc-state-machine: process-outgoing-packet called, polling the results-queue ~%" )
    7070  (let ((result (nio-compat:take (result-queue sm) :blocking-call nil)))
    7171    (format t "yarpc-state-machine: process-outgoing-packet got result ~A ~%" result)
     
    7676(defmethod process-incoming-packet ((sm yarpc-state-machine) (call call-method-packet))
    7777  (assert (eql (state sm) STATE-INITIALISED))
    78   (format t "yarpc-state-machine:process-incoming-packet called :sm ~A :packet ~A~%" sm call)
     78  (format-log t "yarpc-state-machine:process-incoming-packet called :sm ~A :packet ~A~%" sm call)
    7979  (nio-compat:add job-queue (list (call-string call) (result-queue sm)))
    8080  (when +process-jobs-inline+ (run-job :wait-on-job-pdw nil)))
  • TabularUnified branches/home/psmith/restructure/src/statemachine/state-machine.lisp

    r44 r48  
    5858  (with-slots (foreign-read-buffer) sm
    5959    (let ((incoming-packet (get-packet (get-packet-factory sm) foreign-read-buffer)))
    60       (format t "~A state-machine::process-read - incoming packet: ~A~%" (nio-compat:get-readable-time) incoming-packet)
     60      (format-log t "state-machine::process-read - incoming packet: ~A~%" incoming-packet)
    6161      (when incoming-packet
    6262          (when (not (process-incoming-packet sm incoming-packet))
     
    6868  (with-slots (foreign-write-buffer) sm
    6969  (let ((outgoing-packet (process-outgoing-packet sm)))
    70     (format t "~A state-machine::process-write - outgoing packet: ~A~%" (nio-compat:get-readable-time) outgoing-packet)
     70    (format-log t "state-machine::process-write - outgoing packet: ~A~%" outgoing-packet)
    7171    (when outgoing-packet (write-bytes outgoing-packet foreign-write-buffer)))))
    7272
Note: See TracChangeset for help on using the changeset viewer.