Converted print traces to logging throughout the app