Logging functionality added