Created
January 13, 2014 02:14
-
-
Save RhysC/8393620 to your computer and use it in GitHub Desktop.
get the warn and errors for the azure emulator log file (assuming pretty std log4net set up)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-AzureEmulatorErrors | |
{ | |
$LocalApplicationDataPath = [Environment]::GetFolderPath([System.Environment+SpecialFolder]::LocalApplicationData) | |
$AzureResourceRoot = "$LocalApplicationDataPath\dftmp\Resources" | |
Write-Host "Local Azure Resource Root: $AzureResourceRoot" | |
pushd "$AzureResourceRoot" | |
$logs = (dir -Recurse *\directory\LoggingStorage\*.log) | |
$ErrorAndWarnLines = $logs | Select-String -pattern "\[ERROR\]|\[WARN \]" | |
$entries = $ErrorAndWarnLines | select LineNumber, ` | |
Line, ` | |
@{Name="Path";Expression={$_.RelativePath($AzureResourceRoot)}}, ` | |
@{Name="Level";Expression={$_.Line.Substring(1,5)}}, ` | |
@{Name="Project";Expression={$_.Path.Split('\')[-1].Split('.')[0]}} | |
popd | |
return $entries | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment