redux-logger
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -16,10 +16,22 @@ 'use strict'; | ||
console.group('action ' + action.type + ' @', time.getHours() + ':' + time.getMinutes() + ':' + time.getSeconds()); | ||
if (typeof console !== 'undefined') { | ||
var message = 'action ' + action.type + ' @ ' + time.getHours() + ':' + time.getMinutes() + ':' + time.getSeconds(); | ||
console.log('%c prev state', 'color: #9E9E9E; font-weight: bold', prevState); | ||
console.log('%c action', 'color: #03A9F4; font-weight: bold', action); | ||
console.log('%c next state', 'color: #4CAF50; font-weight: bold', nextState); | ||
try { | ||
console.group(message); | ||
} catch (e) { | ||
console.log('NOT GROUP'); | ||
} | ||
console.groupEnd('diff'); | ||
console.log('%c prev state', 'color: #9E9E9E; font-weight: bold', prevState); | ||
console.log('%c action', 'color: #03A9F4; font-weight: bold', action); | ||
console.log('%c next state', 'color: #4CAF50; font-weight: bold', nextState); | ||
try { | ||
console.group('—— log end ——'); | ||
} catch (e) { | ||
console.log('—— log end ——'); | ||
} | ||
} | ||
return returnValue; | ||
@@ -26,0 +38,0 @@ }; |
{ | ||
"name": "redux-logger", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Logger for redux", | ||
@@ -5,0 +5,0 @@ "main": "build/logger.js", |
@@ -8,10 +8,22 @@ function logger({ getState }) { | ||
console.group(`action ${action.type} @`, `${time.getHours()}:${time.getMinutes()}:${time.getSeconds()}`); | ||
if (typeof console !== 'undefined') { | ||
const message = `action ${action.type} @ ${time.getHours()}:${time.getMinutes()}:${time.getSeconds()}`; | ||
console.log(`%c prev state`, `color: #9E9E9E; font-weight: bold`, prevState); | ||
console.log(`%c action`, `color: #03A9F4; font-weight: bold`, action); | ||
console.log(`%c next state`, `color: #4CAF50; font-weight: bold`, nextState); | ||
try { | ||
console.group(message); | ||
} catch(e) { | ||
console.log('NOT GROUP'); | ||
} | ||
console.groupEnd('diff'); | ||
console.log(`%c prev state`, `color: #9E9E9E; font-weight: bold`, prevState); | ||
console.log(`%c action`, `color: #03A9F4; font-weight: bold`, action); | ||
console.log(`%c next state`, `color: #4CAF50; font-weight: bold`, nextState); | ||
try { | ||
console.group('—— log end ——'); | ||
} catch(e) { | ||
console.log('—— log end ——'); | ||
} | ||
} | ||
return returnValue; | ||
@@ -18,0 +30,0 @@ }; |
Sorry, the diff of this file is too big to display
208566
981