@@ -34,6 +34,7 @@ internal sealed class FormattingEngineImplementation : IFormattingEngine
3434 private readonly IEnumerable < IGlobalSemanticFormattingRule > _globalSemanticRules ;
3535 private readonly Stopwatch _watch = new Stopwatch ( ) ;
3636 private bool _allowTables ;
37+ private bool _verbose ;
3738
3839 public ImmutableArray < string > CopyrightHeader
3940 {
@@ -64,6 +65,12 @@ public bool AllowTables
6465 get { return _allowTables ; }
6566 set { _allowTables = value ; }
6667 }
68+
69+ public bool Verbose
70+ {
71+ get { return _verbose ; }
72+ set { _verbose = value ; }
73+ }
6774
6875 public bool ConvertUnicodeCharacters
6976 {
@@ -213,7 +220,10 @@ private void StartDocument()
213220 private void EndDocument ( Document document )
214221 {
215222 _watch . Stop ( ) ;
216- FormatLogger . WriteLine ( " {0} {1} seconds" , document . Name , _watch . Elapsed . TotalSeconds ) ;
223+ if ( _verbose )
224+ {
225+ FormatLogger . WriteLine ( " {0} {1} seconds" , document . Name , _watch . Elapsed . TotalSeconds ) ;
226+ }
217227 }
218228
219229 /// <summary>
@@ -224,7 +234,7 @@ private void EndDocument(Document document)
224234 /// </summary>
225235 private async Task < Solution > RunSyntaxPass ( Solution originalSolution , IReadOnlyList < DocumentId > documentIds , CancellationToken cancellationToken )
226236 {
227- FormatLogger . WriteLine ( "Syntax Pass" ) ;
237+ FormatLogger . WriteLine ( "\t Syntax Pass" ) ;
228238
229239 var currentSolution = originalSolution ;
230240 foreach ( var documentId in documentIds )
@@ -264,7 +274,7 @@ private SyntaxNode RunSyntaxPass(SyntaxNode root, string languageName)
264274
265275 private async Task < Solution > RunLocalSemanticPass ( Solution solution , IReadOnlyList < DocumentId > documentIds , CancellationToken cancellationToken )
266276 {
267- FormatLogger . WriteLine ( "Local Semantic Pass" ) ;
277+ FormatLogger . WriteLine ( "\t Local Semantic Pass" ) ;
268278 foreach ( var localSemanticRule in _localSemanticRules )
269279 {
270280 solution = await RunLocalSemanticPass ( solution , documentIds , localSemanticRule , cancellationToken ) ;
@@ -275,7 +285,11 @@ private async Task<Solution> RunLocalSemanticPass(Solution solution, IReadOnlyLi
275285
276286 private async Task < Solution > RunLocalSemanticPass ( Solution originalSolution , IReadOnlyList < DocumentId > documentIds , ILocalSemanticFormattingRule localSemanticRule , CancellationToken cancellationToken )
277287 {
278- FormatLogger . WriteLine ( " {0}" , localSemanticRule . GetType ( ) . Name ) ;
288+ if ( _verbose )
289+ {
290+ FormatLogger . WriteLine ( " {0}" , localSemanticRule . GetType ( ) . Name ) ;
291+ }
292+
279293 var currentSolution = originalSolution ;
280294 foreach ( var documentId in documentIds )
281295 {
@@ -301,7 +315,7 @@ private async Task<Solution> RunLocalSemanticPass(Solution originalSolution, IRe
301315
302316 private async Task < Solution > RunGlobalSemanticPass ( Solution solution , IReadOnlyList < DocumentId > documentIds , CancellationToken cancellationToken )
303317 {
304- FormatLogger . WriteLine ( "Global Semantic Pass" ) ;
318+ FormatLogger . WriteLine ( "\t Global Semantic Pass" ) ;
305319 foreach ( var globalSemanticRule in _globalSemanticRules )
306320 {
307321 solution = await RunGlobalSemanticPass ( solution , documentIds , globalSemanticRule , cancellationToken ) ;
@@ -312,7 +326,11 @@ private async Task<Solution> RunGlobalSemanticPass(Solution solution, IReadOnlyL
312326
313327 private async Task < Solution > RunGlobalSemanticPass ( Solution solution , IReadOnlyList < DocumentId > documentIds , IGlobalSemanticFormattingRule globalSemanticRule , CancellationToken cancellationToken )
314328 {
315- FormatLogger . WriteLine ( " {0}" , globalSemanticRule . GetType ( ) . Name ) ;
329+ if ( _verbose )
330+ {
331+ FormatLogger . WriteLine ( " {0}" , globalSemanticRule . GetType ( ) . Name ) ;
332+ }
333+
316334 foreach ( var documentId in documentIds )
317335 {
318336 var document = solution . GetDocument ( documentId ) ;
0 commit comments