]> gitweb.factorcode.org Git - factor.git/commitdiff
mason: more useful logging to console, with timestamps
authorSlava Pestov <slava@factorcode.org>
Sat, 10 Sep 2011 02:33:13 +0000 (19:33 -0700)
committerSlava Pestov <slava@factorcode.org>
Sat, 10 Sep 2011 03:21:05 +0000 (20:21 -0700)
extra/mason/build/build.factor
extra/mason/common/common.factor
extra/mason/email/email.factor
extra/mason/git/git.factor
extra/mason/notify/notify.factor

index 1b8089ed5e1104b6ac5b29d4e1ea0259196eb50e..03c5decc333f70b9705730be855f345da5c10f66 100644 (file)
@@ -1,8 +1,8 @@
-! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
+! Copyright (C) 2008, 2011 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: arrays kernel calendar io.directories io.encodings.utf8
 io.files io.launcher io.pathnames namespaces prettyprint
-combinators mason.child mason.cleanup mason.common mason.config
+combinators sequences mason.child mason.cleanup mason.common mason.config
 mason.docs mason.release mason.report mason.email mason.git
 mason.notify mason.platform mason.updates ;
 QUALIFIED: continuations
@@ -13,9 +13,11 @@ IN: mason.build
     build-dir make-directory ;
 
 : enter-build-dir  ( -- )
+    "Building in directory " build-dir append print-timestamp
     build-dir set-current-directory ;
 
 : clone-source ( -- )
+    "Cloning GIT repository" print-timestamp
     "git" "clone" builds-dir get "factor" append-path 3array
     short-running-process ;
 
index 798f4d166a02b956fac57427f5f64e620ee77375..8599c4e1d39b783e3f526c79f07b66dce6faacc4 100644 (file)
@@ -1,4 +1,4 @@
-! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
+! Copyright (C) 2008, 2011 Eduardo Cavazos, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: kernel namespaces sequences splitting system accessors
 math.functions make io io.files io.pathnames io.directories
@@ -8,6 +8,9 @@ calendar.format arrays mason.config locals debugger fry
 continuations strings io.sockets ;
 IN: mason.common
 
+: print-timestamp ( string -- )
+    now timestamp>string write bl print flush ;
+
 ERROR: no-host-name ;
 
 : short-host-name ( -- string )
index 68724b3ffa2be6ef40c342c3320a73d0dd8133f1..d5ebb4bdc2d88da022af1e66e81bb69834838692 100644 (file)
@@ -16,7 +16,7 @@ IN: mason.email
             _ >>subject
         send-email
     ] [
-        "E-MAILING FAILED:" print
+        "E-MAILING FAILED:" print-timestamp
         error. flush
     ] recover ;
 
index df344be12e54d4a3314364a1654bba1495872f31..9740a6ebe521a2d4b1db371d79d3c1873cb15c43 100644 (file)
@@ -21,6 +21,7 @@ IN: mason.git
 
 : git-clone ( -- )
     #! Must be run from builds-dir
+    "Cloning initial repository" print-timestamp
     git-clone-cmd try-output-process ;
 
 : git-pull-cmd ( -- cmd )
index 89ddce590d85d7da124937c57e936100547d7922..7946c3b0d3bb31abbf663ba1b530ab3d8bf5dbee 100644 (file)
@@ -28,7 +28,7 @@ IN: mason.notify
                 http-post 2drop
             ] retry
         ] [
-            "STATUS NOTIFY FAILED:" print
+            "STATUS NOTIFY FAILED:" print-timestamp
             error. flush
         ] recover
     ] [ 3drop ] if ;
@@ -40,24 +40,24 @@ IN: mason.notify
     f f "idle" status-notify ;
 
 : notify-begin-build ( git-id -- )
-    [ "Starting build of GIT ID " write print flush ]
+    [ "Starting build of GIT ID " prepend print-timestamp ]
     [ f swap "git-id" status-notify ]
     bi ;
 
 : notify-make-vm ( -- )
-    "Compiling VM" print flush
+    "Compiling VM" print-timestamp
     f f "make-vm" status-notify ;
 
 : notify-boot ( -- )
-    "Bootstrapping" print flush
+    "Bootstrapping" print-timestamp
     f f "boot" status-notify ;
 
 : notify-test ( -- )
-    "Running tests" print flush
+    "Running tests" print-timestamp
     f f "test" status-notify ;
 
 : notify-report ( status -- )
-    [ "Build finished with status: " write . flush ]
+    [ name>> "Build finished with status: " prepend print-timestamp ]
     [
         [ "report" utf8 file-contents ] dip
         [ name>> "report" status-notify ] [ email-report ] 2bi
@@ -70,6 +70,6 @@ IN: mason.notify
     f f "finish" status-notify ;
 
 : notify-release ( archive-name -- )
-    [ "Uploaded " prepend [ print flush ] [ mason-tweet ] bi ]
+    [ "Uploaded " prepend [ print-timestamp ] [ mason-tweet ] bi ]
     [ f swap "release" status-notify ]
     bi ;