unified log function to debug