-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Users/ranjanar/logs errorstream bugs (#4089)
* Input logs and the error stream redirection for vstest.console.exe * Removing extra spaces * Made the info logs localizable.. And Removed failOnStderr.. * CR commets
- Loading branch information
1 parent
3b65a44
commit a669bb2
Showing
8 changed files
with
217 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import * as stream from 'stream'; | ||
import * as os from 'os'; | ||
import * as tl from 'vsts-task-lib/task'; | ||
|
||
export class StringErrorWritable extends stream.Writable { | ||
private value: string = ''; | ||
|
||
constructor(options: any) { | ||
super(options); | ||
} | ||
|
||
_write(data: any, encoding: string, callback: Function): void { | ||
this.value += data; | ||
|
||
let errorString: string = data.toString(); | ||
let n = errorString.indexOf(os.EOL); | ||
while (n > -1) { | ||
const line = errorString.substring(0, n); | ||
tl.error(line); | ||
|
||
// the rest of the string ... | ||
errorString = errorString.substring(n + os.EOL.length); | ||
n = errorString.indexOf(os.EOL); | ||
} | ||
if (callback) { | ||
callback(); | ||
} | ||
} | ||
|
||
toString(): string { | ||
return this.value; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.