@@ -106,7 +106,7 @@ export default class Almanac {
106106 } else {
107107 fact = new Fact ( id , valueOrMethod , options )
108108 }
109- debug ( ` almanac::addFact id:${ factId } ` )
109+ debug ( ' almanac::addFact' , { id : factId } )
110110 this . factMap . set ( factId , fact )
111111 if ( fact . isConstant ( ) ) {
112112 this . _setFactValue ( fact , { } , fact . value )
@@ -121,7 +121,7 @@ export default class Almanac {
121121 * @param {Mixed } value - constant value of the fact
122122 */
123123 addRuntimeFact ( factId , value ) {
124- debug ( ` almanac::addRuntimeFact id:${ factId } ` )
124+ debug ( ' almanac::addRuntimeFact' , { id : factId } )
125125 const fact = new Fact ( factId , value )
126126 return this . _addConstantFact ( fact )
127127 }
@@ -151,22 +151,22 @@ export default class Almanac {
151151 const cacheVal = cacheKey && this . factResultsCache . get ( cacheKey )
152152 if ( cacheVal ) {
153153 factValuePromise = Promise . resolve ( cacheVal )
154- debug ( ` almanac::factValue cache hit for fact: ${ factId } ` )
154+ debug ( ' almanac::factValue cache hit for fact' , { id : factId } )
155155 } else {
156- debug ( ` almanac::factValue cache miss for fact: ${ factId } ; calculating` )
156+ debug ( ' almanac::factValue cache miss, calculating' , { id : factId } )
157157 factValuePromise = this . _setFactValue ( fact , params , fact . calculate ( params , this ) )
158158 }
159159 }
160160 if ( path ) {
161- debug ( ` condition::evaluate extracting object property ${ path } ` )
161+ debug ( ' condition::evaluate extracting object' , { property : path } )
162162 return factValuePromise
163163 . then ( factValue => {
164164 if ( isObjectLike ( factValue ) ) {
165165 const pathValue = this . pathResolver ( factValue , path )
166- debug ( ` condition::evaluate extracting object property ${ path } , received: ${ JSON . stringify ( pathValue ) } ` )
166+ debug ( ' condition::evaluate extracting object' , { property : path , received : pathValue } )
167167 return pathValue
168168 } else {
169- debug ( ` condition::evaluate could not compute object path( ${ path } ) of non-object: ${ factValue } < ${ typeof factValue } >; continuing with ${ factValue } ` )
169+ debug ( ' condition::evaluate could not compute object path of non-object' , { path , factValue, type : typeof factValue } )
170170 return factValue
171171 }
172172 } )
0 commit comments