Skip to content

Commit

Permalink
TW-72330 Sometimes build log skips errors from .NET runner
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolayPianikov authored and NikolayPianikov committed Aug 4, 2021
1 parent 68d76b9 commit 6d37089
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion TeamCity.MSBuild.Logger/Composer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static Composer()
.Bind<IEnvironment>().To<Environment>()
.Bind<IDiagnostics>().To<Diagnostics>()
.Bind<ILoggerContext>().To<LoggerContext>()
.Bind<IConsole>().To<DefaultConsole>()
.Bind<IConsole>().Bind<IInitializable>().To<DefaultConsole>()
.Bind<IStringService>().To<StringService>()
.Bind<IPathService>().To<PathService>()
.Bind<IParametersParser>().To<ParametersParser>()
Expand Down
4 changes: 3 additions & 1 deletion TeamCity.MSBuild.Logger/DefaultConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using JetBrains.Annotations;

// ReSharper disable once ClassNeverInstantiated.Global
internal class DefaultConsole : IConsole
internal class DefaultConsole : IConsole, IInitializable
{
[NotNull] private readonly IDiagnostics _diagnostics;
[NotNull] private readonly TextWriter _out;
Expand All @@ -19,6 +19,8 @@ public DefaultConsole([NotNull] IDiagnostics diagnostics)
// https://youtrack.jetbrains.com/issue/TW-72330
_out = Console.Out;
}

public void Initialize() { }

public void Write(string text)
{
Expand Down
8 changes: 8 additions & 0 deletions TeamCity.MSBuild.Logger/IInitializable.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace TeamCity.MSBuild.Logger
{
// ReSharper disable once IdentifierTypo
interface IInitializable
{
void Initialize();
}
}
3 changes: 3 additions & 0 deletions TeamCity.MSBuild.Logger/NodeLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ internal class NodeLogger : INodeLogger
private int _reentrancy;

public NodeLogger(
// ReSharper disable once UnusedParameter.Local
// ReSharper disable once IdentifierTypo
[NotNull] IInitializable[] initializables,
[NotNull] IParametersParser parametersParser,
[NotNull] ILogWriter logWriter,
[NotNull] ILoggerContext context,
Expand Down

0 comments on commit 6d37089

Please sign in to comment.