Change debug func to support client IP