src/le.js
function Logger(options) {
        var logger;

        // Default values
        var dict = {
            ssl: true,
            catchall: false,
            trace: true,
            page_info: 'never',
            print: false,
            endpoint: null,
            token: null
        };

        if (typeof options === "object")
            for (var k in options)
                dict[k] = options[k];
        else
            throw new Error("Invalid parameters for createLogStream()");

        if (dict.token === null) {
            throw new Error("Token not present.");
        } else {
            logger = new LogStream(dict);
        }

        var _log = function(msg) {
            if (logger) {
                return logger.log.apply(this, arguments);
            } else
                throw new Error("You must call LE.init(...) first.");
        };

         // The public interface
        return {
            log: function() {
                _log.apply(this, arguments).level('LOG').send();
            },
            warn: function() {
                _log.apply(this, arguments).level('WARN').send();
            },
            error: function() {
                _log.apply(this, arguments).level('ERROR').send();
            },
            info: function() {
                _log.apply(this, arguments).level('INFO').send();
            }
        };
    }
function Logger(options) {
        var logger;

        // Default values
        var dict = {
            ssl: true,
            catchall: false,
            trace: true,
            page_info: 'never',
            print: false,
            endpoint: null,
            token: null
        };

        if (typeof options === "object")
            for (var k in options)
                dict[k] = options[k];
        else
            throw new Error("Invalid parameters for createLogStream()");

        if (dict.token === null) {
            throw new Error("Token not present.");
        } else {
            logger = new LogStream(dict);
        }

        var _log = function(msg) {
            if (logger) {
                return logger.log.apply(this, arguments);
            } else
                throw new Error("You must call LE.init(...) first.");
        };

         // The public interface
        return {
            log: function() {
                _log.apply(this, arguments).level('LOG').send();
            },
            warn: function() {
                _log.apply(this, arguments).level('WARN').send();
            },
            error: function() {
                _log.apply(this, arguments).level('ERROR').send();
            },
            info: function() {
                _log.apply(this, arguments).level('INFO').send();
            }
        };
    }
function Logger ( options ) { var logger ; // Default values var dict = { ssl : true , catchall : false , trace : true , page_info : 'never' , print : false , endpoint : null , token : null } ; if ( typeof options === "object" ) for ( var k in options ) dict [ k ] = options [ k ] ; else throw new Error ( "Invalid parameters for createLogStream()" ) ; if ( dict . token === null ) { throw new Error ( "Token not present." ) ; } else { logger = new LogStream ( dict ) ; } var _log = function ( msg ) { if ( logger ) { return logger . log . apply ( this , arguments ) ; } else throw new Error ( "You must call LE.init(...) first." ) ; } ; // The public interface return { log : function ( ) { _log . apply ( this , arguments ) . level ( 'LOG' ) . send ( ) ; } , warn : function ( ) { _log . apply ( this , arguments ) . level ( 'WARN' ) . send ( ) ; } , error : function ( ) { _log . apply ( this , arguments ) . level ( 'ERROR' ) . send ( ) ; } , info : function ( ) { _log . apply ( this , arguments ) . level ( 'INFO' ) . send ( ) ; } } ; }
A single log object
@constructor
@param {Object} options
A single log object