SQLAlchemy-based nested logging