Modified log function in Swift Class.