2 * input.js: Instance of a single Loggly input
4 * (C) 2010 Nodejitsu Inc.
9 var Input = exports.Input = function (client, details) {
11 throw new Error("Input must be constructed with at least basic details.");
15 this._setProperties(details);
18 Input.prototype.log = function (msg, callback) {
19 return this.client.log(this.input_token, msg, callback);
22 Input.prototype.addDevice = function (address, callback) {
23 this.client.addDeviceToInput(this.id, address, callback);
27 // Sets the properties for this instance
28 // Parameters: details
30 Input.prototype._setProperties = function (details) {
31 // Copy the properties to this instance
33 Object.keys(details).forEach(function (key) {
34 self[key] = details[key];