Write-LogMain entry point for writing console and file logs with levels, rotation, JSON, and optional colors.