Fixed write-to-global
Made it so that you can set a custom logging function
fix logger using a global closure for config + bump to latest expect version