MiniLogger.st
changeset 20491 692f8c7c92f4
parent 20490 f1c27208211f
child 20492 862c7e4b0964
equal deleted inserted replaced
20490:f1c27208211f 20491:692f8c7c92f4
   760             messageProperlyEncoded := message utf8Encoded.
   760             messageProperlyEncoded := message utf8Encoded.
   761         ] ifFalse:[
   761         ] ifFalse:[
   762             messageProperlyEncoded := OperatingSystem encodePath: message.
   762             messageProperlyEncoded := OperatingSystem encodePath: message.
   763         ]
   763         ]
   764     ].
   764     ].
   765 
   765     messageProperlyEncoded := messageProperlyEncoded withoutSeparators.
       
   766     
   766     "/ hack to allow calls from infPrint/errorPrint.
   767     "/ hack to allow calls from infPrint/errorPrint.
   767     "/ if this is an oldStyle infoPrint or errorPrint, do not append another facility and severity
   768     "/ if this is an oldStyle infoPrint or errorPrint, do not append another facility and severity
   768     words := message asCollectionOfWords.
   769     words := message asCollectionOfWords.
   769     (words size > 2
   770     (words size > 2
   770     and:[ words first isAlphaNumeric
   771     and:[ words first isAlphaNumeric
   778         (messageProperlyEncoded startsWith:$:) ifTrue:[
   779         (messageProperlyEncoded startsWith:$:) ifTrue:[
   779             messageProperlyEncoded := (messageProperlyEncoded copyFrom:2) withoutSeparators.
   780             messageProperlyEncoded := (messageProperlyEncoded copyFrom:2) withoutSeparators.
   780         ].
   781         ].
   781     ].
   782     ].
   782     
   783     
   783     Timestamp now printOn:aStream format:'%(year)-%(mon)-%(day) %h:%m:%s.%i'.
   784     "/ Timestamp now printOn:aStream format:'%(year)-%(mon)-%(day) %h:%m:%s.%i'.
   784     aStream space.
   785     "/ aStream space.
   785     aStream
   786     aStream
   786         nextPutAll: facility ? 'STX';
   787         nextPutAll: facility ? 'STX';
   787         nextPutAll:' [';
   788         nextPutAll:' [';
   788         nextPutAll: severityName;
   789         nextPutAll: severityName;
   789         nextPutAll:']:';
   790         nextPutAll:']'.
   790         space.
   791 
       
   792     aStream nextPutAll:' ('.
       
   793     Timestamp now printOn:aStream format:'%(year)-%(mon)-%(day) %h:%m:%s.%i'.
       
   794     aStream nextPutAll:'): '.
   791 
   795 
   792     aStream nextPutAll: messageProperlyEncoded.
   796     aStream nextPutAll: messageProperlyEncoded.
   793     aStream cr.
   797     aStream cr.
   794 
   798 
   795     "
   799     "