@@ -105,7 +105,7 @@ export default class Almanac {
105105    }  else  { 
106106      fact  =  new  Fact ( id ,  valueOrMethod ,  options ) 
107107    } 
108-     debug ( ` almanac::addFact  id:${ factId } ` ) 
108+     debug ( ' almanac::addFact' ,   {   id :  factId   } ) 
109109    this . factMap . set ( factId ,  fact ) 
110110    if  ( fact . isConstant ( ) )  { 
111111      this . _setFactValue ( fact ,  { } ,  fact . value ) 
@@ -120,7 +120,7 @@ export default class Almanac {
120120   * @param  {Mixed } value - constant value of the fact 
121121   */ 
122122  addRuntimeFact  ( factId ,  value )  { 
123-     debug ( ` almanac::addRuntimeFact  id:${ factId } ` ) 
123+     debug ( ' almanac::addRuntimeFact' ,   {   id :  factId   } ) 
124124    const  fact  =  new  Fact ( factId ,  value ) 
125125    return  this . _addConstantFact ( fact ) 
126126  } 
@@ -150,22 +150,22 @@ export default class Almanac {
150150      const  cacheVal  =  cacheKey  &&  this . factResultsCache . get ( cacheKey ) 
151151      if  ( cacheVal )  { 
152152        factValuePromise  =  Promise . resolve ( cacheVal ) 
153-         debug ( ` almanac::factValue cache hit for fact: ${ factId } ` ) 
153+         debug ( ' almanac::factValue cache hit for fact' ,   {   id :  factId   } ) 
154154      }  else  { 
155-         debug ( ` almanac::factValue cache miss for fact: ${ factId } ; calculating` ) 
155+         debug ( ' almanac::factValue cache miss, calculating' ,   {   id :  factId   } ) 
156156        factValuePromise  =  this . _setFactValue ( fact ,  params ,  fact . calculate ( params ,  this ) ) 
157157      } 
158158    } 
159159    if  ( path )  { 
160-       debug ( ` condition::evaluate extracting object  property  ${ path } ` ) 
160+       debug ( ' condition::evaluate extracting object' ,   {   property :  path   } ) 
161161      return  factValuePromise 
162162        . then ( factValue  =>  { 
163163          if  ( factValue  !=  null  &&  typeof  factValue  ===  'object' )  { 
164164            const  pathValue  =  this . pathResolver ( factValue ,  path ) 
165-             debug ( ` condition::evaluate extracting object  property  ${ path } ${ JSON . stringify ( pathValue ) } ` ) 
165+             debug ( ' condition::evaluate extracting object' ,   {   property :  path ,  received : pathValue   } ) 
166166            return  pathValue 
167167          }  else  { 
168-             debug ( ` condition::evaluate could not compute object path( ${ path } )  of non-object:  ${ factValue }  < ${ typeof  factValue } >; continuing with  ${ factValue } ` ) 
168+             debug ( ' condition::evaluate could not compute object path of non-object' ,   {  path ,  factValue,   type :  typeof   factValue   } ) 
169169            return  factValue 
170170          } 
171171        } ) 
0 commit comments