# HG changeset patch # User Claus Gittinger # Date 1488361167 -3600 # Node ID d8639d4653d583e7d57b2e2f36ebe72695e2e64c # Parent 806379005cacc8c63e4c25da09694329c7e00c1a #REFACTORING by cg class: Class added: #logFacility diff -r 806379005cac -r d8639d4653d5 Class.st --- a/Class.st Wed Mar 01 10:39:08 2017 +0100 +++ b/Class.st Wed Mar 01 10:39:27 2017 +0100 @@ -4097,6 +4097,42 @@ ^ self theMetaclass includesSelector:#start ! +logFacility + "the 'log facility'; + this is used by the Logger both as a prefix to the log message, + and maybe (later) used to filter and/or control per-facility log thresholds. + The default here is to base the facility on the package: + if the class is anywhere in the base ST/X system, 'STX' is returned as facility. + Otherwise, the last component of the package name is returned." + + |pkg| + + ((pkg := self package ? '???') startsWith:'stx:') ifTrue:[ + ^ 'STX' + ]. + ^ pkg copyFrom:((pkg lastIndexOf:$:) + 1) + + " + Array logFacility + Array class logFacility + Class new logFacility + Behavior new logFacility + + Expecco::Browser logFacility + Workflow::Executor logFacility + + Array package + Array class package + Class new package + Behavior new package + + Expecco::Browser package + Workflow::Executor package + " + + "Created: / 01-03-2017 / 10:32:39 / cg" +! + methodsForWhich:aFilter "return a collection of methods (both class and inst) for which aFilter returns true"