1111*/
1212component accessors = " true" {
1313
14-
14+
1515 /**
1616 * The LogBox unique ID
1717 */
@@ -21,12 +21,12 @@ component accessors="true"{
2121 * The LogBox operating version
2222 */
2323 property name = " version" ;
24-
24+
2525 /**
2626 * The appender registration map
2727 */
2828 property name = " appenderRegistry" type = " struct" ;
29-
29+
3030 /**
3131 * The Logger registration map
3232 */
@@ -67,7 +67,7 @@ component accessors="true"{
6767 variables .categoryAppenders = " " ;
6868 // Version
6969 variables .version = " @build.version@+@build.number@" ;
70-
70+
7171 // Link incoming ColdBox argument
7272 variables .coldbox = arguments .coldbox ;
7373
@@ -79,7 +79,7 @@ component accessors="true"{
7979
8080 /**
8181 * Configure logbox for operation. You can also re-configure LogBox programmatically. Basically we register all appenders here and all categories
82- *
82+ *
8383 * @config The LogBoxConfig object to use to configure this instance of LogBox: coldbox.system.logging.config.LogBoxConfig
8484 * @config.doc_generic coldbox.system.logging.config.LogBoxConfig
8585 */
@@ -109,7 +109,7 @@ component accessors="true"{
109109 levelMax = rootConfig .levelMax ,
110110 appenders = getAppendersMap ( rootConfig .appenders )
111111 };
112-
112+
113113 // Save in Registry
114114 variables .loggerRegistry = {
115115 " ROOT" = new coldbox .system .logging .Logger ( argumentCollection = args )
@@ -119,7 +119,7 @@ component accessors="true"{
119119
120120 /**
121121 * Get the root logger object
122- *
122+ *
123123 * @return coldbox.system.logging.Logger
124124 */
125125 function getRootLogger (){
@@ -128,16 +128,16 @@ component accessors="true"{
128128
129129 /**
130130 * Get a logger object configured with a category name and appenders. If not configured, then it reverts to the root logger defined for this instance of LogBox
131- *
131+ *
132132 * @category The category name to use in this logger or pass in the target object will log from and we will inspect the object and use its metadata name
133- *
133+ *
134134 * @return coldbox.system.logging.Logger
135135 */
136136 function getLogger ( required category ){
137137 var root = getRootLogger ();
138138
139139 // is category object?
140- if ( isObject ( arguments .category ) ){
140+ if ( isObject ( arguments .category ) ){
141141 arguments .category = getMetadata ( arguments .category ).name ;
142142 }
143143
@@ -202,7 +202,7 @@ component accessors="true"{
202202
203203 /**
204204 * Register a new appender object in the appender registry.
205- *
205+ *
206206 * @name A unique name for the appender to register. Only unique names can be registered per variables.
207207 * @class The appender's class to register. We will create, init it and register it for you.
208208 * @properties The structure of properties to configure this appender with.
@@ -222,9 +222,9 @@ component accessors="true"{
222222 if ( ! structKeyExists ( variables .appenderRegistry , arguments .name ) ){
223223
224224 lock name = " #variables .logboxID #.registerappender.#name #" type = " exclusive" timeout = " 15" throwOnTimeout = " true" {
225-
225+
226226 if ( ! structKeyExists ( variables .appenderRegistry , arguments .name ) ){
227-
227+
228228 // Create appender and linking
229229 var oAppender = new " #arguments .class #" ( argumentCollection = arguments );
230230 oAppender .setColdBox ( variables .coldbox );
@@ -247,7 +247,7 @@ component accessors="true"{
247247
248248 /**
249249 * Get a parent logger according to category convention inheritance. If not found, it returns the root logger.
250- *
250+ *
251251 * @category The category name to investigate for parents
252252 */
253253 private function locateCategoryParentLogger ( required category ){
@@ -278,20 +278,24 @@ component accessors="true"{
278278
279279 /**
280280 * Get a map of appenders by list. Usually called to get a category of appenders
281- *
281+ *
282282 * @appenders The list of appenders to get
283283 */
284284 struct function getAppendersMap ( required appenders ){
285285 var results = arguments .appenders
286286 .listToArray ()
287287 .reduce ( function ( result , item , index ){
288- var target = result ?: structNew ();
288+ var target = {};
289+ if ( ! isNull ( arguments .result ) ){
290+ target = result ;
291+ }
289292 target [ item ] = variables .appenderRegistry [ item ];
290293 return target ;
291294 } );
292- return results ?: structnew ();
295+
296+ return ( isNull ( results ) ? structNew () : results );
293297 }
294-
298+
295299 /**
296300 * Get Utility Object
297301 */
0 commit comments