MiniLogger.st
changeset 21626 e4578e01f37f
parent 21614 a84ce930ffde
child 21640 721cffbe9b6f
--- a/MiniLogger.st	Sun Mar 05 11:44:33 2017 +0100
+++ b/MiniLogger.st	Mon Mar 06 11:03:22 2017 +0100
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 2012-2014 by Jan Vrany & eXept Software AG
               All Rights Reserved
@@ -744,234 +742,333 @@
 !
 
 fatal: format with: arg1 with: arg2 with:arg3
-    FATAL < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > FATAL) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+    
     self log: (format bindWith: arg1 with: arg2 with:arg3) severity: FATAL originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:54:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 06-03-2017 / 11:02:49 / cg"
 !
 
 info: message
-    INFO < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > INFO) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: message severity: INFO originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:01 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:00:07 / cg"
 !
 
 info: format with: arg1
-    INFO < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > INFO) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1) severity: INFO originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:00:12 / cg"
 !
 
 info: format with: arg1 with: arg2
-    INFO < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > INFO) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2) severity: INFO originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:00:15 / cg"
 !
 
 info: format with: arg1 with: arg2 with:arg3
-    INFO < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > INFO) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2 with:arg3) severity: INFO originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:00:19 / cg"
 !
 
 leave: message
-    LEAVE < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > LEAVE) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: message severity: LEAVE originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:00:29 / cg"
 !
 
 leave: format with: arg1
-    LEAVE < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > LEAVE) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1) severity: LEAVE originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 06-03-2017 / 11:00:37 / cg"
 !
 
 leave: format with: arg1 with: arg2
-    LEAVE < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > LEAVE) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2) severity: LEAVE originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:00:43 / cg"
 !
 
 leave: format with: arg1 with: arg2 with:arg3
-    LEAVE < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > LEAVE) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2 with:arg3) severity: LEAVE originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:22 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:00:46 / cg"
 !
 
 trace0: message
-    TRACE0 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE0) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: message severity: TRACE0 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:40 / cg"
 !
 
 trace0: format with: arg1
-    TRACE0 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE0) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1) severity: TRACE0 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:37 / cg"
 !
 
 trace0: format with: arg1 with: arg2
-    TRACE0 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE0) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2) severity: TRACE0 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:34 / cg"
 !
 
 trace0: format with: arg1 with: arg2 with:arg3
-    TRACE0 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE0) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2 with:arg3) severity: TRACE0 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:31 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:28 / cg"
 !
 
 trace1: message
-    TRACE1 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE1) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: message severity: TRACE1 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:22 / cg"
 !
 
 trace1: format with: arg1
-    TRACE1 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE1) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1) severity: TRACE1 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:18 / cg"
 !
 
 trace1: format with: arg1 with: arg2
-    TRACE1 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE1) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2) severity: TRACE1 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:15 / cg"
 !
 
 trace1: format with: arg1 with: arg2 with:arg3
-    TRACE1 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE1) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2 with:arg3) severity: TRACE1 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:43 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:11 / cg"
 !
 
 trace2: message
-    TRACE2 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE2) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: message severity: TRACE2 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:05 / cg"
 !
 
 trace2: format with: arg1
-    TRACE2 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE2) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1) severity: TRACE2 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:02:02 / cg"
 !
 
 trace2: format with: arg1 with: arg2
-    TRACE2 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE2) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2) severity: TRACE2 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:59 / cg"
 !
 
 trace2: format with: arg1 with: arg2 with:arg3
-    TRACE2 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE2) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2 with:arg3) severity: TRACE2 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:52 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:55 / cg"
 !
 
 trace3: message
-    TRACE3 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE3) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: message severity: TRACE3 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:48 / cg"
 !
 
 trace3: format with: arg1
-    TRACE3 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE3) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1) severity: TRACE3 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:55:59 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:45 / cg"
 !
 
 trace3: format with: arg1 with: arg2
-    TRACE3 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE3) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2) severity: TRACE3 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:42 / cg"
 !
 
 trace3: format with: arg1 with: arg2 with:arg3
-    TRACE3 < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE3) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2 with:arg3) severity: TRACE3 originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:39 / cg"
 !
 
 trace: message
-    TRACE < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: message severity: TRACE originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:06 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:33 / cg"
 !
 
 trace: format with: arg1
-    TRACE < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1) severity: TRACE originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:30 / cg"
 !
 
 trace: format with: arg1 with: arg2
-    TRACE < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2) severity: TRACE originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified (format): / 06-03-2017 / 11:01:25 / cg"
 !
 
 trace: format with: arg1 with: arg2 with:arg3
-    TRACE < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > TRACE) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2 with:arg3) severity: TRACE originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:17 / cg"
 !
 
 warning: message
-    WARN < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > WARN) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: message severity: WARN originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:00:59 / cg"
 !
 
 warning: format with: arg1
-    WARN < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > WARN) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1) severity: WARN originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:04 / cg"
 !
 
 warning:format with:arg1 with:arg2
-    WARN < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > WARN) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith: arg1 with: arg2) severity: WARN originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:07 / cg"
 !
 
 warning:format with:arg1 with:arg2 with:arg3
-    WARN < Threshold ifTrue:[ ^ self ].
+    "/ a quick rejector to avoid overhead in deployed apps
+    ((Threshold > WARN) and:[ThresholdPerClass isNil and:[ThresholdPerPackage isNil]]) ifTrue:[ ^ self ].
+
     self log: (format bindWith:arg1 with:arg2 with:arg3) severity: WARN originator: thisContext sender receiver
 
     "Modified: / 02-12-2014 / 10:56:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 06-03-2017 / 11:01:09 / cg"
 ! !
 
 !MiniLogger class methodsFor:'private'!
@@ -1064,7 +1161,7 @@
      Logger log:'test message' severity: DEBUG facility: 'TEST'
      Logger log:'test message' severity: INFO facility: 'TEST'
      Logger log:'test message' asUnicode16String severity: INFO facility: 'TEST'
-     Logger log:'test message äöüß' severity: INFO facility: 'TEST'
+     Logger log:'test message äöüß' severity: INFO facility: 'TEST'
      Logger log:'test message' severity: WARNING facility: 'TEST'
      Logger log:'test message' severity: ERROR facility: 'TEST'
      'test message' infoPrintCR