smarter logging