How to use the dustjs-linkedin.debugLevel function in dustjs-linkedin

To help you get started, we’ve selected a few dustjs-linkedin 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 epinna / tplmap / tests / env_node_tests / connect-app.js View on Github external
app.use('/blind/dust', function(req, res){
  if(req.url) {
    var url_parts = url.parse(req.url, true);

    var inj = url_parts.query.inj;
    var tpl = '';
    if('tpl' in url_parts.query && url_parts.query.tpl != '') {
      // Keep the formatting a-la-python
      tpl = url_parts.query.tpl.replace('%s', inj);
    }
    else {
      tpl = inj;
    }
    
    console.log('PAYLOAD: ' + tpl);
    dust.debugLevel = "DEBUG"
    var compiled = dust.compile(tpl, "compiled");
    dust.loadSource(compiled);
    dust.render("compiled", {}, function(err, outp) { })
    
    res.end(randomstring.generate());
  }
});
github gitana / cloudcms-server / duster / index.js View on Github external
var util = require("../util/util");

var dust = require("dustjs-linkedin");
require("dustjs-helpers");

// we always set dust cache to false
// this is because dust cache is file path dependent (could collide across tenants)s
dust.config.cache = false;

// instead we manage our own template cache
var TEMPLATE_CACHE = {};

if (process.env.CLOUDCMS_APPSERVER_MODE === "production") {
    dust.debugLevel = "INFO";
} else {
    dust.debugLevel = "DEBUG";
    dust.config.cache = false;
}

if (process.env.CLOUDCMS_APPSERVER_MODE !== "production") {
    dust.config.whitespace = true;
}

if (process.env.DUST_DEBUG_LEVEL) {
    dust.debugLevel = (process.env.DUST_DEBUG_LEVEL + "").toUpperCase();
}

/**
 * Override Dust's isThenable() function so that Gitana driver chainable objects aren't included.
 *
 * @param elem
 * @returns {*|boolean}
github dadi / web / dadi / lib / dust / index.js View on Github external
Dust.prototype.setDebugLevel = function (debugLevel) {
  dust.debugLevel = debugLevel
}