Socket
Socket
Sign inDemoInstall

loggly

Package Overview
Dependencies
68
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.8 to 1.0.9

.travis.yml

2

lib/loggly.js

@@ -22,2 +22,2 @@ /*

//
loggly.Search = require('./loggly/search').Search;
loggly.Search = require('./loggly/search').Search;

@@ -18,8 +18,6 @@ /*

function stringify(msg) {
// This trims Circular references
var decycle = function () {},
payload;
var payload;
try { payload = JSON.stringify(msg) }
catch(ex) { payload = stringifySafe(msg, null, null, decycle) }
catch (ex) { payload = stringifySafe(msg, null, null, noop) }

@@ -59,3 +57,3 @@ return payload;

this.userAgent = 'node-loggly ' + loggly.version;
this.useTagHeader = "useTagHeader" in options ? options.useTagHeader : true;
this.useTagHeader = 'useTagHeader' in options ? options.useTagHeader : true;

@@ -104,3 +102,2 @@ //

//

@@ -111,3 +108,3 @@ // Remark: Have some extra logic for detecting if we want to make a bulk

var isBulk = Array.isArray(msg);
function serialize (msg) {
function serialize(msg) {
if (msg instanceof Object) {

@@ -117,5 +114,5 @@ return self.json ? stringify(msg) : common.serialize(msg);

else {
return self.json ? stringify({ message : msg }) : msg;
return self.json ? stringify({ message: msg }) : msg;
}
};
}

@@ -129,4 +126,4 @@ msg = isBulk ? msg.map(serialize).join('\n') : serialize(msg);

headers: {
'host': this.host,
'accept': '*/*',
host: this.host,
accept: '*/*',
'user-agent': this.userAgent,

@@ -150,3 +147,3 @@ 'content-type': this.json ? 'application/json' : 'text/plain',

if (tags) {
//decide whether to add tags as http headers or add them to the URI.
// Decide whether to add tags as http headers or add them to the URI.
if (this.useTagHeader) {

@@ -156,3 +153,3 @@ logOptions.headers['X-LOGGLY-TAG'] = tags.join(',');

else {
logOptions.uri += "/tag/" + tags.join(",") + "/";
logOptions.uri += '/tag/' + tags.join(',') + '/';
}

@@ -204,3 +201,2 @@ }

//

@@ -257,1 +253,6 @@ // ### function customer (callback)

};
//
// Simple noop function for reusability
//
function noop() {}

@@ -21,11 +21,11 @@ /*

var failCodes = common.failCodes = {
400: "Bad Request",
401: "Unauthorized",
403: "Forbidden",
404: "Not Found",
409: "Conflict / Duplicate",
410: "Gone",
500: "Internal Server Error",
501: "Not Implemented",
503: "Throttled"
400: 'Bad Request',
401: 'Unauthorized',
403: 'Forbidden',
404: 'Not Found',
409: 'Conflict / Duplicate',
410: 'Gone',
500: 'Internal Server Error',
501: 'Not Implemented',
503: 'Throttled'
};

@@ -38,7 +38,7 @@

var successCodes = common.successCodes = {
200: "OK",
201: "Created",
202: "Accepted",
203: "Non-authoritative information",
204: "Deleted",
200: 'OK',
201: 'Created',
202: 'Accepted',
203: 'Non-authoritative information',
204: 'Deleted'
};

@@ -79,3 +79,3 @@

//
if (args.length == 1) {
if (args.length === 1) {
if (typeof args[0] === 'string') {

@@ -89,10 +89,10 @@ //

else {
method = args[0]['method'] || 'GET',
uri = args[0]['uri'];
requestBody = args[0]['body'];
auth = args[0]['auth'];
headers = args[0]['headers'];
method = args[0].method || 'GET';
uri = args[0].uri;
requestBody = args[0].body;
auth = args[0].auth;
headers = args[0].headers;
}
}
else if (args.length == 2) {
else if (args.length === 2) {
method = 'GET';

@@ -108,3 +108,3 @@ uri = args[0];

function onError (err) {
function onError(err) {
if (!responded) {

@@ -123,3 +123,3 @@ responded = true;

if (auth) {
requestOptions.headers['authorization'] = 'Basic ' + new Buffer(auth.username + ':' + auth.password).toString('base64');
requestOptions.headers.authorization = 'Basic ' + new Buffer(auth.username + ':' + auth.password).toString('base64');
}

@@ -178,3 +178,3 @@

if (Array.isArray(obj[keys[i]])) {
msg += keys[i] + '=['
msg += keys[i] + '=[';

@@ -214,2 +214,2 @@ for (var j = 0, l = obj[keys[i]].length; j < l; j++) {

return clone;
};
};

@@ -23,3 +23,3 @@ /*

if (!options || (!options.query && !options.q)) {
throw new Error('options.query is required to execute a Loggly search.')
throw new Error('options.query is required to execute a Loggly search.');
}

@@ -162,2 +162,2 @@

return this;
};
};
{
"name": "loggly",
"description": "A client implementation for Loggly cloud Logging-as-a-Service API",
"version": "1.0.8",
"version": "1.0.9",
"author": "Charlie Robbins <charlie.robbins@gmail.com>",
"repository": {
"type": "git",
"url": "http://github.com/nodejitsu/node-loggly.git"
"url": "http://github.com/winstonjs/node-loggly.git"
},

@@ -17,3 +17,3 @@ "keywords": [

"dependencies": {
"request": "2.49.x",
"request": "2.67.x",
"timespan": "2.3.x",

@@ -23,2 +23,3 @@ "json-stringify-safe": "5.0.x"

"devDependencies": {
"common-style": "^3.1.0",
"vows": "0.8.x"

@@ -28,2 +29,3 @@ },

"scripts": {
"pretest": "common lib/**/*.js lib/*.js test/helpers.js",
"test": "vows test/*-test.js --spec"

@@ -30,0 +32,0 @@ },

# node-loggly
A client implementation for Loggly in node.js
[![Version npm](https://img.shields.io/npm/v/loggly.svg?style=flat-square)](https://www.npmjs.com/package/loggly)[![npm Downloads](https://img.shields.io/npm/dm/loggly.svg?style=flat-square)](https://www.npmjs.com/package/loggly)[![Build Status](https://img.shields.io/travis/winstonjs/node-loggly/master.svg?style=flat-square)](https://travis-ci.org/winstonjs/node-loggly)[![Dependencies](https://img.shields.io/david/winstonjs/node-loggly.svg?style=flat-square)](https://david-dm.org/winstonjs/node-loggly)
[![NPM](https://nodei.co/npm/loggly.png?downloads=true&downloadRank=true)](https://nodei.co/npm/loggly/)
A client implementation for Loggly in node.js. Check out Loggly's [Node logging documentation](https://www.loggly.com/docs/nodejs-logs/) for more.
## Usage

@@ -6,0 +10,0 @@

@@ -29,21 +29,13 @@ /*

try {
var configFile = path.join(__dirname, 'data', 'test-config.json'),
stats = fs.statSync(configFile)
config = JSON.parse(fs.readFileSync(configFile).toString());
var config = require('./config');
if (!helpers.validConfig(config)) {
util.puts('Config file test-config.json must be updated with valid data before running tests');
process.exit(0);
throw new Error(util.format('test/config.json: invalid data %j', config));
}
helpers.config = config || {}
return config || {};
helpers.config = config || {};
return helpers.config;
}
catch (ex) {
util.puts('Error parsing test-config.json');
ex.stack.split('\n').forEach(function (line) {
console.log(line);
});
process.exit(0);
console.log('Error parsing test/config.json');
throw ex;
}

@@ -50,0 +42,0 @@ };

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc