Created
April 22, 2015 18:04
-
-
Save JefStat/13ab3917f3ac286f36a8 to your computer and use it in GitHub Desktop.
MSBuild Get verbosity level credit http://stackoverflow.com/questions/4341155/get-the-current-logging-verbosity-level-in-my-msbuild-script
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
<PropertyGroup> | |
<CommandLine>$([System.Environment]::CommandLine.Trim().ToLower())</CommandLine> | |
<IsQuietVerbosity>False</IsQuietVerbosity> | |
<IsMinimalVerbosity>False</IsMinimalVerbosity> | |
<IsNormalVerbosity>True</IsNormalVerbosity> | |
<IsDetailedVerbosity>False</IsDetailedVerbosity> | |
<IsDiagnosticVerbosity>False</IsDiagnosticVerbosity> | |
</PropertyGroup> | |
<PropertyGroup Condition="'$(CommandLine.Contains("/v"))' == 'True'"> | |
<IndexOfLastVerbosityArg>$(CommandLine.LastIndexOf("/v"))</IndexOfLastVerbosityArg> | |
<IndexOfVerbosityArg>$(CommandLine.IndexOf(":", $(IndexOfLastVerbosityArg)))</IndexOfVerbosityArg> | |
<IndexOfVerbosityArg>$([MSBuild]::Add($(IndexOfVerbosityArg), 1))</IndexOfVerbosityArg> | |
<IndexOfEndOfVerbosityArg>$(CommandLine.IndexOf(" ", $(IndexOfVerbosityArg)))</IndexOfEndOfVerbosityArg> | |
<IndexOfEndOfVerbosityArg Condition="'$(IndexOfEndOfVerbosityArg)' == '-1'">$(CommandLine.Length)</IndexOfEndOfVerbosityArg> | |
<LengthOfVerbosityArg>$([MSBuild]::Subtract($(IndexOfEndOfVerbosityArg), $(IndexOfVerbosityArg)))</LengthOfVerbosityArg> | |
<VerbosityLevel>$(CommandLine.Substring($(IndexOfVerbosityArg), $(LengthOfVerbosityArg)).Trim())</VerbosityLevel> | |
<IsQuietVerbosity>$(VerbosityLevel.StartsWith('q'))</IsQuietVerbosity> | |
<IsMinimalVerbosity>$(VerbosityLevel.StartsWith('m'))</IsMinimalVerbosity> | |
<IsNormalVerbosity>$(VerbosityLevel.StartsWith('n'))</IsNormalVerbosity> | |
<IsDiagnosticVerbosity>$(VerbosityLevel.StartsWith('di'))</IsDiagnosticVerbosity> | |
<IsDetailedVerbosity Condition="'$(IsDiagnosticVerbosity)' == 'False'">$(VerbosityLevel.StartsWith('d'))</IsDetailedVerbosity> | |
</PropertyGroup> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment