Skip to content

Instantly share code, notes, and snippets.

@JLChnToZ
Last active August 4, 2022 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JLChnToZ/26200b10921155f065fbf390f45c97ed to your computer and use it in GitHub Desktop.
Save JLChnToZ/26200b10921155f065fbf390f45c97ed to your computer and use it in GitHub Desktop.
Live view VRChat runtime log on console legally (mod-free)
$Host.UI.RawUI.WindowTitle = 'VRChat Log'
$Host.UI.RawUI.BackgroundColor = 'Black'
$Host.PrivateData.VerboseForegroundColor = 'White'
Clear-Host
Get-Content -Tail $Host.UI.RawUI.BufferSize.Height -Wait -Encoding UTF8 (Get-ChildItem -Path "$($Env:LocalAppData)Low\VRChat\VRChat" -Filter 'output_log_*.txt' | Sort-Object LastWriteTime -Descending | Select-Object -First 1 | ForEach-Object {$_.FullName}) | Where-Object {$_.Trim() -ne ''} | ForEach-Object {
if ($_ -match '^\d{4}\.\d{2}\.\d{2}\s\d{2}:\d{2}:\d{2}\sError') {
$Host.UI.RawUI.ForegroundColor = $Host.PrivateData.ErrorForegroundColor
$Host.UI.RawUI.BackgroundColor = $Host.PrivateData.ErrorBackgroundColor
} elseif ($_ -match '^\d{4}\.\d{2}\.\d{2}\s\d{2}:\d{2}:\d{2}\sException') {
$Host.UI.RawUI.ForegroundColor = $Host.PrivateData.ErrorForegroundColor
$Host.UI.RawUI.BackgroundColor = $Host.PrivateData.ErrorBackgroundColor
} elseif ($_ -match '^\d{4}\.\d{2}\.\d{2}\s\d{2}:\d{2}:\d{2}\sWarning') {
$Host.UI.RawUI.ForegroundColor = $Host.PrivateData.WarningForegroundColor
$Host.UI.RawUI.BackgroundColor = $Host.PrivateData.WarningBackgroundColor
} elseif ($_ -match '^\d{4}\.\d{2}\.\d{2}\s\d{2}:\d{2}:\d{2}\sLog') {
$Host.UI.RawUI.ForegroundColor = $Host.PrivateData.VerboseForegroundColor
$Host.UI.RawUI.BackgroundColor = $Host.PrivateData.VerboseBackgroundColor
}
$_
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment