File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -142,11 +142,11 @@ static IEnumerable<IBuildServer> GetApplicableBuildServers(Arguments arguments)
142
142
143
143
static void ConfigureLogging ( Arguments arguments )
144
144
{
145
- Action < string > writeAction = x => { } ;
145
+ var writeActions = new List < Action < string > > ( ) ;
146
146
147
- if ( arguments . LogFilePath == "console" )
147
+ if ( arguments . LogFilePath == "console" || arguments . Output == OutputType . BuildServer )
148
148
{
149
- writeAction = Console . WriteLine ;
149
+ writeActions . Add ( Console . WriteLine ) ;
150
150
}
151
151
else if ( arguments . LogFilePath != null )
152
152
{
@@ -158,17 +158,17 @@ static void ConfigureLogging(Arguments arguments)
158
158
using ( File . CreateText ( arguments . LogFilePath ) ) { }
159
159
}
160
160
161
- writeAction = x => WriteLogEntry ( arguments , x ) ;
161
+ writeActions . Add ( x => WriteLogEntry ( arguments , x ) ) ;
162
162
}
163
163
catch ( Exception ex )
164
164
{
165
165
Console . WriteLine ( "Failed to configure logging: " + ex . Message ) ;
166
166
}
167
167
}
168
168
169
- Logger . WriteInfo = writeAction ;
170
- Logger . WriteWarning = writeAction ;
171
- Logger . WriteError = writeAction ;
169
+ Logger . WriteInfo = s => writeActions . ForEach ( a => a ( s ) ) ;
170
+ Logger . WriteWarning = s => writeActions . ForEach ( a => a ( s ) ) ;
171
+ Logger . WriteError = s => writeActions . ForEach ( a => a ( s ) ) ;
172
172
}
173
173
174
174
static void WriteLogEntry ( Arguments arguments , string s )
You can’t perform that action at this time.
0 commit comments