All Projects → KirillOsenkov → Msbuildstructuredlog

KirillOsenkov / Msbuildstructuredlog

Licence: mit
A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.

Projects that are alternatives of or similar to Msbuildstructuredlog

Viewerjs
JavaScript image viewer.
Stars: ✭ 6,270 (+534.62%)
Mutual labels:  viewer
Exhibit
Exhibit is a managed screensaver App for tvOS.
Stars: ✭ 19 (-98.08%)
Mutual labels:  viewer
Blazm.components
A few useful and awesome components for Blazor. Blazor + awesome (azm)=Blazm (Blossom)
Stars: ✭ 29 (-97.06%)
Mutual labels:  nuget
Rulesengine
A Json based Rules Engine with extensive Dynamic expression support
Stars: ✭ 714 (-27.73%)
Mutual labels:  nuget
Eylogviewer
A simple viewer to see your app's logs on your iDevice in realtime.
Stars: ✭ 16 (-98.38%)
Mutual labels:  viewer
Apos.input
Polling input library for MonoGame.
Stars: ✭ 25 (-97.47%)
Mutual labels:  nuget
Xamarinmediamanager
Cross platform Xamarin plugin to play and control Audio and Video
Stars: ✭ 647 (-34.51%)
Mutual labels:  nuget
Computesharp
A .NET 5 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders, with the goal of making GPU computing easy to use for all .NET developers! 🚀
Stars: ✭ 982 (-0.61%)
Mutual labels:  nuget
Centrifuge
Cross-platform runtime mod loader and API for any Unity-based game. Supports Unity 5 and up!
Stars: ✭ 18 (-98.18%)
Mutual labels:  nuget
Jukeboks
Jukeboks is a fast viewer / player app
Stars: ✭ 21 (-97.87%)
Mutual labels:  viewer
Zathura
a document viewer
Stars: ✭ 769 (-22.17%)
Mutual labels:  viewer
Nservicebus.kafka
Kafka transport for NServiceBus
Stars: ✭ 16 (-98.38%)
Mutual labels:  nuget
Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+618.42%)
Mutual labels:  nuget
Svg
Fork of the ms svg library (http://svg.codeplex.com/)
Stars: ✭ 676 (-31.58%)
Mutual labels:  nuget
Lumberjack
A terminal-ui log watcher written in Go using the Flux architecture
Stars: ✭ 31 (-96.86%)
Mutual labels:  viewer
Fo Dicom
Fellow Oak DICOM for .NET, .NET Core, Universal Windows, Android, iOS, Mono and Unity
Stars: ✭ 674 (-31.78%)
Mutual labels:  nuget
Speckleviewer
⚠️ deprecated; viewer is now integrated in https://github.com/speckleworks/SpeckleAdmin
Stars: ✭ 23 (-97.67%)
Mutual labels:  viewer
Viewer
⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-viewer
Stars: ✭ 985 (-0.3%)
Mutual labels:  viewer
Ghpr.nunit
Adapter for NUnit 3 (generate HTML report for NUnit 3)
Stars: ✭ 33 (-96.66%)
Mutual labels:  nuget
Myanimelistsharp
Access MyAnimeList Web API using .NET library
Stars: ✭ 10 (-98.99%)
Mutual labels:  nuget

MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values. It can greatly simplify build investigations and provides a portable log interchange format and a rich interactive log viewer app.

Build status NuGet package Chocolatey

Homepage: https://msbuildlog.com

View binlogs in the Browser: https://live.msbuildlog.com

Important: the NuGet package is now being published to https://nuget.org/packages/MSBuild.StructuredLogger (old location: https://nuget.org/packages/Microsoft.Build.Logging.StructuredLogger). Please update to use the new Package Id.

Thanks to https://signpath.io for generously providing a certificate to sign the installer. signpath.io

Install:

https://github.com/KirillOsenkov/MSBuildStructuredLog/releases/download/v2.1.305/MSBuildStructuredLogSetup.exe

The app updates automatically via Squirrel (after launch it checks for updates in background), next launch starts the newly downloaded latest version.

Screenshot1

Installing the Avalonia version on Mac:

There are a couple of extra steps to get the .app running on macOS since it's currently distributed as an unsigned application:

  1. In System Preferences -> Security & Privacy ensure Allow apps downloaded from: is set to App Store and identified developers.
  2. Download the Structured Log Viewer.zip file from the latest Release.
  3. If necessary, unzip the file (Safari does this for you after downloading automatically).
  4. Move the Structured Log Viewer.app into your Applications folder.
  5. In terminal run: chmod +x /Applications/Structured\ Log\ Viewer.app/Contents/MacOS/StructuredLogViewer.Avalonia to give the app execution permissions
  6. Run the app. You will be prompted that the app is not signed by a known developer. Click cancel.
  7. In System Preferences -> Security & Privacy click Open anyway where the app should now be visible near the setting from step 1.

Building & Running the Avalonia version on Mac:

git clone https://github.com/KirillOsenkov/MSBuildStructuredLog
./run.sh

Alternatively, a longer version:

  1. dotnet build
  2. dotnet publish --self-contained -o <some_dir> (I used $HOME/tools/artifacts/StructuredLogViewer.Avalonia)
  3. make a script $HOME/bin/structured-log-viewer (or whatever's on your PATH):
#! /bin/sh
exec dotnet ${HOME}/tools/artifacts/StructuredLogViewer.Avalonia/publish/StructuredLogViewer.Avalonia.dll "[email protected]"

Requirements:

Windows:

  • .NET Framework 4.7.2
  • MSBuild 16.0
  • Visual Studio 2019

Mac:

  • .NET Core SDK

Usage:

Starting with MSBuild 15.3 you can just pass the new /bl switch to msbuild.exe to record a binary build log to msbuild.binlog, in the same folder as the project/solution being built:

Screenshot

or you can build the solution or open an existing log file through the viewer app:

Screenshot2

Alternatively (useful for older versions of MSBuild) you can attach the logger to any MSBuild-based build using the logger library: StructuredLogger.dll. It is available in a NuGet package: https://www.nuget.org/packages/MSBuild.StructuredLogger

msbuild solution.sln /t:Rebuild /v:diag /noconlog /logger:BinaryLogger,%localappdata%\MSBuildStructuredLogViewer\app-2.1.305\StructuredLogger.dll;1.binlog

To use a portable version of the logger (e.g. with the dotnet msbuild command) you need a .NET Standard version of StructuredLogger.dll, not the .NET Framework (Desktop) version.

Download this NuGet package: https://www.nuget.org/packages/MSBuild.StructuredLogger/2.1.303 and inside it there's the lib\netstandard2.0\StructuredLogger.dll. Try passing that to dotnet build like this:

dotnet msbuild Some.sln /v:diag /nologo /logger:BinaryLogger,"packages\MSBuild.StructuredLogger.2.1.303\lib\netstandard2.0\StructuredLogger.dll";"C:\Users\SomeUser\Desktop\binarylog.binlog"

The logger supports three file formats:

  1. *.binlog (official MSBuild binary log format, same as msbuild.exe /bl)
  2. *.buildlog (when you Save As... in the Viewer)
  3. *.xml (for large human-readable XML logs)

The viewer can read all 3 formats and can save to either .buildlog or .xml.

Read more about the log formats here: https://github.com/KirillOsenkov/MSBuildStructuredLog/wiki/Log-Format

Features:

  • Displays double-writes (when files from different sources are written to the same destination during a build, thus causing non-determinism)
  • Displays target dependencies for each target
  • Text search through the entire log
  • Narrow down the search results using the under() clause to only display results under a certain parent.
  • Each node in the tree has a context menu. Ctrl+C to copy an item and the entire subtree to Clipboard as text.
  • Delete to hide nodes from the tree (to get uninteresting stuff out of the way).
  • Open and save log files (ask a friend to record and send you the log which you can then investigate on your machine)
  • Logs can include the source code project files and all imported files used during the build.
  • If a log has embedded files, you can view the list of files, full-text search in all files, and use the Space key (or double-click) on most nodes to view the source code.
  • If MSBuild 15.3 or later was used during the build the log can also display a preprocessed view for each project, with all imported projects inlined.
  • The viewer associates with *.binlog and *.buildlog so you can double-click a log file in Explorer to open it.

Differences between StructuredLogger and the new BinaryLogger that is shipped with MSBuild as of 15.3

Starting with Visual Studio 2017 Update 3 MSBuild supports a new BinaryLogger documented here: https://github.com/Microsoft/MSBuild/wiki/Binary-Log

BinaryLogger is the low-level and exact representation of the events that happened during the build in the original order. You can fully reconstruct other build logs from a binary log by "playing back" the log file. .binlog is the file extension. Pass a .binlog file to MSBuild instead of a project or solution to "replay it" and specify the target loggers to replay to as if a real build was happening.

StructuredLogger is the format used by the viewer to save build trees to disk. It is as comprehensive as the binary log, but you can't easily reconstruct other logs from this format, it is only used by the viewer.

The Structured Log Viewer is able to open both formats, but can only save the .buildlog format. Here are some differences between the BinaryLogger and the StructuredLogger:

  • BinaryLogger (format used by msbuild /bl) will consume less memory and disk size, whereas the StructuredLogger .buildlog format may run out of memory on very large builds (by design).

  • StructuredLogger captures the target graph so it is able to show DependsOn list for each target and also order targets slightly better in some cases.

  • StructuredLogger is slightly more compact since it is not streaming and thus able to use string deduplication, reducing the log file up to 10x smaller compared to .binlog.

  • BinaryLogger is replayable and you're able to reconstruct text logs of any verbosity out of it. It is hard to reconstruct text logs of conventional format from a StructuredLogger log.

Other than that they're pretty much equivalent and both can be opened in the viewer.

Investigating problems with MSBuildStructuredLog

Open an issue if you're running into something weird and I can take a look into it. If MSBuildStructuredLog crashes during the build, it will attempt to write the exception call stack to:

%localappdata%\Microsoft\MSBuildStructuredLog\LoggerExceptions.txt

MSBuild Resources

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].