You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following discussion in #234 I propose a very simple customizable (error) logging. Instead of hard coding console.error(err), define the global logging API with the default implementation, e.g.
constdstoreLog={exception(err){console.error(err);}// ... other functions}
then exchange all console.error(err) for dstoreLog.exception(err). Everything work backward compatible. But a library user may easily plug in own handler, e.g.
dstoreLog.exception=(err)=>{// some custom code for error reporting}
And that's all, very simple and no external dependencies.
Note: I have not a big experience with JS, but this pattern is used in C# libraries very often.
The text was updated successfully, but these errors were encountered:
Following discussion in #234 I propose a very simple customizable (error) logging. Instead of hard coding
console.error(err)
, define the global logging API with the default implementation, e.g.then exchange all
console.error(err)
fordstoreLog.exception(err)
. Everything work backward compatible. But a library user may easily plug in own handler, e.g.And that's all, very simple and no external dependencies.
Note: I have not a big experience with JS, but this pattern is used in C# libraries very often.
The text was updated successfully, but these errors were encountered: