How to use the comb.logger function in comb

To help you get started, we’ve selected a few comb 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 C2FO / hare / lib / index.js View on Github external
"use strict";
var _Options = require("./_options"),
    Queue = require("./queue"),
    Exchange = require("./exchange"),
    amqp = require("amqp"),
    comb = require("comb"),
    LOGGER = comb.logger("hare"),
    isHash = comb.isHash,
    Promise = comb.Promise,
    Rpc = require("./rpc");

var SUBSCRIBE_OPTIONS = {},
    CONNECTION_OPTIONS = {};

function errorHandler(err) {
    if (LOGGER.appenders && LOGGER.appenders.length) {
        LOGGER.error.apply(LOGGER, arguments);
    } else {
        console.error(err.stack || err);
    }
}

var connect = (function connectWrapper() {
github C2FO / patio / lib / associations / manyToMany.js View on Github external
isUndefined = comb.isUndefined,
    isUndefinedOrNull = comb.isUndefinedOrNull,
    isFunction = comb.isFunction,
    isInstanceOf = comb.isInstanceOf,
    sql = require("../sql").sql,
    array = comb.array,
    isBoolean = comb.isBoolean,
    when = comb.when,
    zip = array.zip,
    Promise = comb.Promise,
    PromiseList = comb.PromiseList,
    OneToMany = require("./oneToMany"),
    pluralize = comb.pluralize,
    AssociationError = require("../errors").AssociationError;

var LOGGER = comb.logger("comb.associations.ManyToMany");
/**
 * @class Class to define a manyToMany association.
 *
 * <br>
 * <b>NOT to be instantiated directly</b>
 * Its just documented for reference.
 *
 * @name ManyToMany
 * @augments patio.associations.OneToMany
 * @memberOf patio.associations
 *
 * @param {String} options.joinTable the joinTable of the association.
 *
 *
 * @property {String} joinTable the join table used in the relation.
 * */
github C2FO / werker / lib / worker / index.js View on Github external
"use strict";
var comb = require("comb"),
    merge = comb.merge,
    extender = require("extender"),
    argsToArray = comb.argsToArray,
    isArray = comb.isArray,
    LOGGER = comb.logger("werker.worker");

var errorHandler = comb(function errorHandler(message, err) {
    if (message instanceof Error) {
        err = message;
        message = err.message;
    }
    if (isArray(err)) {
        err.forEach(function (err) {
            LOGGER.warn(err.stack || err);
        });
    } else if (err) {
        LOGGER.warn(err.stack || err);
    } else if (message) {
        LOGGER.warn(message);
    } else {
        LOGGER.error(new Error("UNKNOWN"));
github C2FO / hare / lib / exchange.js View on Github external
"use strict";
var comb = require("comb"),
    Queue = require("./queue"),
    _Options = require("./_options"),
    _GetConnection = require("./_getConnection"),
    Promise = comb.Promise,
    when = comb.when,
    LOGGER = comb.logger("hare.exchange");

var ExchangeQueue = comb.define(Queue, {

    instance: {

        constructor: function (name, exchange) {
            this._super(arguments);
            this._exchange = exchange;
            this.exchange(exchange.exchangeName);
        },

        publish: function (routingKey, message, opts) {
            var argLength = arguments.length;
            if (argLength === 1) {
                message = routingKey;
                routingKey = this.queueName || this.get("routingKey") || '';
github C2FO / patio / lib / index.js View on Github external
Model = model.Model,
    plugins = require("./plugins"),
    comb = require("comb"),
    Time = require("./time"),
    date = comb.date,
    SQL = require("./sql").sql,
    Promise = comb.Promise,
    PromiseList = comb.PromiseList,
    singleton = comb.singleton,
    isFunction = comb.isFunction,
    executeInOrder = comb.executeInOrder,
    argsToArray = comb.argsToArray,
    isString = comb.isString,
    patio = exports;

var LOGGER = comb.logger("patio");

var Patio = singleton([EventEmitter, Time], {
    instance: {
        /**
         * @lends patio.prototype
         */

        __camelize: false,

        __underscore: false,

        __inImportOfModels: false,

        __parseInt8: false,
github C2FO / werker / lib / pool / pool.js View on Github external
"use strict";
var comb = require("comb"),
    Promise = comb.Promise,
    PromiseList = comb.PromiseList,
    isFunction = comb.isFunction,
    Queue = comb.collections.Queue,
    merge = comb.merge,
    define = comb.define,
    Pool = comb.collections.Pool,
    LOGGER = comb.logger("werker.pool");


define(Pool, {

    instance: {

        ttlTimeout: 1000,

        /**
         * WorkerPool to create a pool of workers.
         * @constructs
         * @param options
         */
        constructor: function (options) {
            options = options || {};
            if (!options.createWorker || !isFunction(options.createWorker)) {
github C2FO / patio / lib / dataset / index.js View on Github external
isFunction = comb.isFunction,
    isNull = comb.isNull,
    merge = comb.merge,
    define = comb.define,
    graph = require("./graph"),
    actions = require("./actions"),
    features = require("./features"),
    query = require("./query"),
    sql = require("./sql"),
    SQL = require("../sql").sql,
    AliasedExpression = SQL.AliasedExpression,
    Identifier = SQL.Identifier,
    QualifiedIdentifier = SQL.QualifiedIdentifier;


var LOGGER = comb.logger("patio.Dataset");
define([actions, graph, features, query, sql], {
    instance: {

        /**@lends patio.Dataset.prototype*/

        /**
         * Class that is used for querying/retrieving datasets from a database.
         *
         * <p> Dynamically generated methods include
         * </p><ul>
         *     <li>Join methods from {@link patio.Dataset.CONDITIONED_JOIN_TYPES} and
         *         {@link  patio.Dataset.UNCONDITIONED_JOIN_TYPES}, these methods handle the type call
         *         to {@link patio.Dataset#joinTable}, so to invoke include all arguments that
         *         {@link patio.Dataset#joinTable} requires except the type parameter. The default list includes.
         *         <ul>
         *             <li>Conditioned join types that accept conditions.</li></ul></li></ul>