Demi.js middleware for advanced logging