import { TestConstants } from '../TestConstants' ; /*********************************************************************
 * Copyright (c) 2019 Red Hat, Inc.
 *
 * This program and the accompanying materials are made
 * available under the terms of the Eclipse Public License 2.0
 * which is available at https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 **********************************************************************/ export abstract class Logger { param text public static error ( text , indentLevel = 1 ) { this . logText ( indentLevel , `[ERROR] ${ text }` ) ; } param text public static warn ( text , indentLevel = 1 ) { if ( TestConstants . TS_SELENIUM_LOG_LEVEL === 'ERROR' ) { return ; } this . logText ( indentLevel , `[WARN] ${ text }` ) ; } param text public static info ( text , indentLevel = 3 ) { if ( TestConstants . TS_SELENIUM_LOG_LEVEL === 'ERROR' || TestConstants . TS_SELENIUM_LOG_LEVEL === 'WARN' ) { return ; } this . logText ( indentLevel , `• ${ text }` ) ; } param text public static debug ( text , indentLevel = 5 ) { if ( TestConstants . TS_SELENIUM_LOG_LEVEL === 'ERROR' || TestConstants . TS_SELENIUM_LOG_LEVEL === 'WARN' || TestConstants . TS_SELENIUM_LOG_LEVEL === 'INFO' ) { return ; } this . logText ( indentLevel , `▼ ${ text }` ) ; } /**
     * Uses for logging of the public methods of the  DriverHelper or
     * private methods inside of pageobjects.
     *  param text public static trace ( text , indentLevel = 6 ) { if ( TestConstants . TS_SELENIUM_LOG_LEVEL === 'ERROR' || TestConstants . TS_SELENIUM_LOG_LEVEL === 'WARN' || TestConstants . TS_SELENIUM_LOG_LEVEL === 'INFO' || TestConstants . TS_SELENIUM_LOG_LEVEL === 'DEBUG' ) { return ; } this . logText ( indentLevel , `‣ ${ text }` ) ; } private static logText ( messageIndentationLevel , text ) { for ( let i = 0 ; i < messageIndentationLevel ; i ++ ) { console . group ( ) ; } console . log ( text ) ; for ( let i = 0 ; i < messageIndentationLevel ; i ++ ) { console . groupEnd ( ) ; } } }