@@ -36,6 +36,9 @@ static void Main()
36
36
return ;
37
37
}
38
38
39
+ if ( ! string . IsNullOrEmpty ( arguments . Proj ) || ! string . IsNullOrEmpty ( arguments . Exec ) )
40
+ arguments . Output = OutputType . BuildServer ;
41
+
39
42
ConfigureLogging ( arguments ) ;
40
43
41
44
var gitPreparer = new GitPreparer ( arguments ) ;
@@ -142,11 +145,16 @@ static IEnumerable<IBuildServer> GetApplicableBuildServers(Arguments arguments)
142
145
143
146
static void ConfigureLogging ( Arguments arguments )
144
147
{
145
- Action < string > writeAction = x => { } ;
148
+ var writeActions = new List < Action < string > > ( ) ;
149
+
150
+ if ( arguments . Output == OutputType . BuildServer )
151
+ {
152
+ writeActions . Add ( Console . WriteLine ) ;
153
+ }
146
154
147
155
if ( arguments . LogFilePath == "console" )
148
156
{
149
- writeAction = Console . WriteLine ;
157
+ writeActions . Add ( Console . WriteLine ) ;
150
158
}
151
159
else if ( arguments . LogFilePath != null )
152
160
{
@@ -158,17 +166,17 @@ static void ConfigureLogging(Arguments arguments)
158
166
using ( File . CreateText ( arguments . LogFilePath ) ) { }
159
167
}
160
168
161
- writeAction = x => WriteLogEntry ( arguments , x ) ;
169
+ writeActions . Add ( x => WriteLogEntry ( arguments , x ) ) ;
162
170
}
163
171
catch ( Exception ex )
164
172
{
165
173
Console . WriteLine ( "Failed to configure logging: " + ex . Message ) ;
166
174
}
167
175
}
168
176
169
- Logger . WriteInfo = writeAction ;
170
- Logger . WriteWarning = writeAction ;
171
- Logger . WriteError = writeAction ;
177
+ Logger . WriteInfo = s => writeActions . ForEach ( a => a ( s ) ) ;
178
+ Logger . WriteWarning = s => writeActions . ForEach ( a => a ( s ) ) ;
179
+ Logger . WriteError = s => writeActions . ForEach ( a => a ( s ) ) ;
172
180
}
173
181
174
182
static void WriteLogEntry ( Arguments arguments , string s )
0 commit comments