[Gradle, JS] Add TeamCity simple message log4js appender

#KT-38109 fixed
This commit is contained in:
Ilya Goncharov
2020-04-09 19:18:16 +03:00
parent 91a25417f5
commit 005ecc5f29
3 changed files with 25 additions and 3 deletions
@@ -1 +1,21 @@
export function tcEscape(str: string): string /*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
export const TEST_IGNORED: string
export const SUITE_START: string
export const SUITE_END: string
export const SUITE_END_NO_DURATION: string
export const TEST_START: string
export const TEST_FAILED: string
export const TEST_FAILED_COMPARISON: string
export const TEST_END: string
export const TEST_END_NO_DURATION: string
export const BLOCK_OPENED: string
export const BLOCK_CLOSED: string
export const SIMPLE_MESSAGE: string
export function tcEscape(str: string): string
export function formatMessage(...str: string[]): string
@@ -16,6 +16,8 @@ export const TEST_END_NO_DURATION = `##teamcity[testFinished name='%s' flowId='%
export const BLOCK_OPENED = `##teamcity[blockOpened name='%s' flowId='%s']` export const BLOCK_OPENED = `##teamcity[blockOpened name='%s' flowId='%s']`
export const BLOCK_CLOSED = `##teamcity[blockClosed name='%s' flowId='%s']` export const BLOCK_CLOSED = `##teamcity[blockClosed name='%s' flowId='%s']`
export const SIMPLE_MESSAGE = `##teamcity[message text='%s']`
/** /**
* from teamcity-service-messages * from teamcity-service-messages
* Copyright (c) 2013 Aaron Forsander * Copyright (c) 2013 Aaron Forsander
@@ -5,13 +5,13 @@
'use strict'; 'use strict';
import {tcEscape} from "./src/teamcity-format" import {formatMessage, SIMPLE_MESSAGE} from "./src/teamcity-format"
const consoleLog = console.log.bind(console); const consoleLog = console.log.bind(console);
function consoleAppender(layout, timezoneOffset) { function consoleAppender(layout, timezoneOffset) {
return (loggingEvent) => { return (loggingEvent) => {
consoleLog(tcEscape(layout(loggingEvent, timezoneOffset))); consoleLog(formatMessage(SIMPLE_MESSAGE, layout(loggingEvent, timezoneOffset)));
}; };
} }