Add logging
Fix cache logging bug
Merge branch 'logging' into dev