Logging function with silence option