How to use the log.debug function in log

To help you get started, we’ve selected a few log examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ballerina-platform / ballerina-lang / composer / diagram / src / plugins / ballerina / model / tree / compilation-unit-node.js View on Github external
addImport(importNode, silent) {
        const pkgName = this.getPackageName(importNode);
        if (this.isExistingPackage(pkgName)) {
            const errorString = 'Package "' + pkgName + '" is already imported.';
            log.debug(errorString);
            return;
        }
        const pkgDeclIndex = _.findLastIndex(this.getTopLevelNodes(), node => TreeUtils.isPackageDeclaration(node));
        const lastImportIndex = _.findLastIndex(this.getTopLevelNodes(), node => TreeUtils.isImport(node));
        let targetIndex = 0; // If there is no a pck node or any import, we'll add it to 0
        if (lastImportIndex !== -1) {
            targetIndex = lastImportIndex + 1;
        } else if (pkgDeclIndex !== -1) {
            targetIndex = pkgDeclIndex + 1;
        }

        let startIndex = 0;
        let insertBefore = this.topLevelNodes[targetIndex];
        if(insertBefore !== undefined){
            const wsList = ASTUtil.extractWS(insertBefore);
            if(wsList.length > 0){
github ballerina-attic / composer / modules / web / js / ballerina / diagram / views / default / position-visitors / if-statement-position-calc.js View on Github external
beginVisit(node) {
        log.debug('visit IfStatementPositionCalcVisitor');
        const parentViewState = node.getParent().getViewState();
        const parentBBox = parentViewState.bBox;
        const viewState = node.getViewState();
        const bBox = viewState.bBox;

        const x = parentBBox.x;
        const y = parentBBox.y + parentViewState.components['drop-zone'].h;
        const statementContainerX = x;
        const statementContainerY = y + DesignerDefaults.blockStatement.heading.height;

        bBox.x = x;
        bBox.y = y;
        viewState.components.statementContainer.x = statementContainerX;
        viewState.components.statementContainer.y = statementContainerY;
    }
github ballerina-attic / composer / modules / web / js / ballerina / visitors / position-calc / variable-definition-statement-position-calc.js View on Github external
beginVisit(node) {
        log.debug('visit VariableDefinitionStatementPositionCalc');
        PositioningUtils.getSimpleStatementPosition(node);
    }
github ballerina-attic / composer / modules / web / js / ballerina / visitors / position-calc / assignment-statement-position-calc.js View on Github external
beginVisit(node) {
        log.debug('visit AssignmentStatementPositionCalc');
        PositioningUtils.getSimpleStatementPosition(node);
        if (ASTFactory.isConnectorInitExpression(node.getChildren()[1])) {
            this.calculateConnectorDeclarationPosition(node);
        }
    }
github ballerina-attic / composer / modules / web / js / ballerina / diagram / views / default / position-visitors / elseif-statement-position-calc.js View on Github external
beginVisit(node) {
        log.debug('visit ElseIfStatementPositionCalcVisitor');
        Utils.getCompoundStatementChildPosition(node);
    }
github ballerina-attic / composer / modules / web / src / core / commands / channel.js View on Github external
this.on('all', (cmdName) => {
            log.debug(`Command Channel: Executing command ${cmdName}`);
        });
    }
github ballerina-attic / composer / modules / web / js / ballerina / visitors / source-gen / type-mapper-function-invocation-expression-visitor.js View on Github external
visitFuncInvocationExpression(functionInvocation) {
        var parent = functionInvocation.getParent();
        var index = _.findIndex(parent.getChildren(), function (aExp) {
            return aExp === functionInvocation;
        });
        if (index !== 0) {
            this.appendSource(',');
        }
        var args = {model: functionInvocation, parent: this};
        functionInvocation.accept(new TypeMapperFunctionInvocationExpressionVisitor(_.get(args, "parent")));
        log.debug('Visit Type Mapper Function Invocation expression');
    }