diff --git a/dockerfiles/lib/typescript/src/internal/dir/che-dir.ts b/dockerfiles/lib/typescript/src/internal/dir/che-dir.ts index 2267043e62e..64cde6a566f 100755 --- a/dockerfiles/lib/typescript/src/internal/dir/che-dir.ts +++ b/dockerfiles/lib/typescript/src/internal/dir/che-dir.ts @@ -36,6 +36,7 @@ import {CheFileStructWorkspaceCommandImpl} from "./chefile-struct/che-file-struc import {CheFileStructWorkspaceLoadingCommand} from "./chefile-struct/che-file-struct"; import {ArgumentProcessor} from "../../spi/decorator/argument-processor"; import {Parameter} from "../../spi/decorator/parameter"; +import {ProductName} from "../../utils/product-name"; /** @@ -154,7 +155,7 @@ export class CheDir { } run() : Promise { - Log.context = 'che(dir)'; + Log.context = ProductName.getShortDisplayName() + '(dir)'; // call the method analyzed from the argument return this.parseArgument().then((methodName) => { diff --git a/dockerfiles/lib/typescript/src/internal/test/che-test.ts b/dockerfiles/lib/typescript/src/internal/test/che-test.ts index 46a48893af1..eb5a8e69b10 100644 --- a/dockerfiles/lib/typescript/src/internal/test/che-test.ts +++ b/dockerfiles/lib/typescript/src/internal/test/che-test.ts @@ -16,6 +16,7 @@ import {Argument} from "../../spi/decorator/parameter"; import {ArgumentProcessor} from "../../spi/decorator/argument-processor"; import {PostFlightCheckTest} from "./impl/post-flight-check-test"; import {Log} from "../../spi/log/log"; +import {ProductName} from "../../utils/product-name"; /** * Entrypoint for the Tests. * @author Florent Benoit @@ -56,7 +57,7 @@ export class CheTest { let classOfTest: any = this.mapOfTests.get(this.testName); if (classOfTest) { // update logger - Log.context = 'che(test/' + this.testName + ')'; + Log.context = ProductName.getShortDisplayName() + '(test/' + this.testName + ')'; var instance = Object.create(classOfTest.prototype); // here we use an array of array as constructor instance is an array and apply method is also using array to give parameter diff --git a/dockerfiles/lib/typescript/src/spi/log/log.ts b/dockerfiles/lib/typescript/src/spi/log/log.ts index 1fd27b7b0fb..34073390846 100644 --- a/dockerfiles/lib/typescript/src/spi/log/log.ts +++ b/dockerfiles/lib/typescript/src/spi/log/log.ts @@ -10,6 +10,7 @@ */ +import {ProductName} from "../../utils/product-name"; /** * Logging class allowing to log message * @author Florent Benoit @@ -17,7 +18,7 @@ export class Log { static debugEnabled : boolean = false; - static context : string = 'che'; + static context : string = ProductName.getShortDisplayName(); static logger : Log; static disabledPrefix : boolean = false; diff --git a/dockerfiles/lib/typescript/src/utils/product-name.ts b/dockerfiles/lib/typescript/src/utils/product-name.ts new file mode 100644 index 00000000000..c5b4b968754 --- /dev/null +++ b/dockerfiles/lib/typescript/src/utils/product-name.ts @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2016 Codenvy, S.A. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Codenvy, S.A. - initial API and implementation + */ + + +/** + * Creates an helper class for getting product name + * @author Florent Benoit + */ +export class ProductName { + static getShortDisplayName() : string { + let productName: string = process.env.CHE_MINI_PRODUCT_NAME; + if (!productName) { + return 'che'; + } + return productName; + } + +} \ No newline at end of file