cassiozen / useStateMachine

The <1 kb state machine hook for React
MIT License
2.38k stars 47 forks source link

Switch non-standard console substitution key #14

Closed cassiozen closed 3 years ago

cassiozen commented 3 years ago

Currently using %o. Change for %s or %j

cassiozen commented 3 years ago

%j won't work on CodeSandbox either - opened issue (https://github.com/codesandbox/codesandbox-client/issues/5793)

Apparently, %o is now standard: https://nodejs.org/api/util.html#util_util_format_format_args

cassiozen commented 3 years ago

Not closing to keep an eye on codesandbox development.

cassiozen commented 3 years ago

Alternative: Given that many sandboxes don't support the %o substitution (neither codesandbox, nor stackblitz), we could use the same patter redux-logger-middleware uses:

console.groupCollapsed('%c event', 'color: gray; font-weight: lighter;', event.type);
  console.log(/*whatever*/);
  console.log(/*whatever*/);
console.groupEnd();