Skip to content

Truncate Target skipped condition message #5315

@KirillOsenkov

Description

@KirillOsenkov

When a Condition is evaluated to false when comparing items with an empty string the following TargetSkippedEventArgs is logged:

Target "ShimReferencePathsWhenCommonTargetsDoesNotUnderstandReferenceAssemblies" skipped, due to false condition; ('@(ReferencePathWithRefAssemblies)' == '') was evaluated as ('C:\Users\Kirill\.nuget\packages\microsoft.netframework.referenceassemblies.net472\1.0.0-alpha-004\build\.NETFramework\v4.7.2\Accessibility.dll;C:\Users\Kirill\.nuget\packages\basicundo\0.9.3\lib\net45\BasicUndo.dll;C:\Users\Kirill\.nuget\packages\castle.core\4.3.1\lib\net45\Castle.Core.dll;C:\Users\Kirill\.nuget\packages\diffplex\1.4.4\lib\net40\DiffPlex.dll;C:\Users\Kirill...

This particular one is 46,284 chars long. A 130 MB binlog contains 33,524 of these, totalling 23,573,872 chars.

I'm thinking when dumping this particular message we should shorten items to say a 1,000 characters? Not sure if there is a situation where we need to have these in full, but they'll be recoverable from the surrounding log context if really necessary. Maybe just take the first two items, concatenate and then truncate to 1,000 chars?

I'm sure the current behavior also results in tons of memory allocations and traffic across nodes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area: Logginghelp wantedIssues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim.triaged

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions