class: LoggingStream
authorClaus Gittinger <cg@exept.de>
Wed, 20 Mar 2013 00:39:10 +0100
changeset 2947 b0791fab5adf
parent 2946 9933c76160ae
child 2948 dc6efd25377b
class: LoggingStream added:5 methods changed:5 methods category of:
LoggingStream.st
--- a/LoggingStream.st	Tue Mar 19 20:57:19 2013 +0100
+++ b/LoggingStream.st	Wed Mar 20 00:39:10 2013 +0100
@@ -69,13 +69,27 @@
     logger := aLogger.
 ! !
 
+!LoggingStream methodsFor:'logging'!
+
+log:messageString
+    logger nextPutLine:messageString.
+! !
+
 !LoggingStream methodsFor:'stream protocol'!
 
+atEnd
+    ^ loggedStream atEnd.
+!
+
+flush
+    loggedStream flush.
+!
+
 next
     |el|
 
     el := loggedStream next.
-    logger nextPutAll:'<<< '; nextPutLine:el storeString.
+    self log:( '<<< ' , el storeString ).
     ^ el
 !
 
@@ -83,35 +97,47 @@
     |els|
 
     els := loggedStream next:n.
-    logger nextPutAll:'<<< '; nextPutLine:els storeString.
+    self log:( '<<< ' , els storeString ).
+    ^ els
+!
+
+nextBytes:n
+    |els|
+
+    els := loggedStream nextBytes:n.
+    self log:( '<<< ' , els storeString ).
     ^ els
 !
 
 nextPut:something
-    logger nextPutAll:'>>> '; nextPutLine:something storeString.
+    self log:( '>>> ' , something storeString).
     loggedStream nextPut:something.
 !
 
 nextPutAll:aCollection
-    logger nextPutAll:'>>> '; nextPutLine:aCollection storeString.
+    self log:( '>>> ' , aCollection storeString).
     loggedStream nextPutAll:aCollection.
 !
 
+readWait
+    ^ loggedStream readWait.
+!
+
 upToEnd
     |els|
 
     els := loggedStream upToEnd.
-    logger nextPutAll:'<<< '; nextPutLine:els storeString.
+    self log:( '<<< ' , els storeString).
     ^ els
 ! !
 
 !LoggingStream class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/LoggingStream.st,v 1.4 2013-03-19 19:57:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/LoggingStream.st,v 1.5 2013-03-19 23:39:10 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic2/LoggingStream.st,v 1.4 2013-03-19 19:57:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/LoggingStream.st,v 1.5 2013-03-19 23:39:10 cg Exp $'
 ! !