Permalink
Browse files

Initial version

  • Loading branch information...
gonerandom committed Jul 22, 2013
1 parent 2967494 commit 6299df4bb19f72fd09954331c1ef0e7af876b333
Showing with 46 additions and 24 deletions.
  1. +1 −0 .gitignore
  2. +21 −3 README.md
  3. +24 −21 lib/winston-sqlserver.js
View
@@ -1,2 +1,3 @@
node_modules
npm-debug.log
+debug.log
View
@@ -1,4 +1,22 @@
-winston-sqlserver
-=================
+# winston-sqlserver
-SQL Server transport for Winston Logger. http://github.com/gonerandom/winston-sqlserver
+This module allows you to log your [winston](//github.com/flatiron/winston/) messages to a SQL Server database using [node-sqlserver](//github.com/WindowsAzure/node-sqlserver/).
+
+## Installation
+
+Coming soon.
+
+## Usage
+
+```js
+var winston = require('winston');
+
+// Requiring `winston-sqlserver` will expose `winston.transports.SQLServer`
+require('winston-sqlserver');
+
+winston.add(winston.transports.SQLServer, options);
+```
+
+## Thanks
+
+Developed based on the [winston-sqlite](//github.com/floatingLomas/winston-sqlite/) and [winston-mail](//github.com/wavded/winston-mail/) projects.
View
@@ -5,26 +5,12 @@ var util = require('util');
var winston = require('winston');
var sql = require('node-sqlserver');
-/**
- * Expose 'SQLServer'
- */
- module.exports = SQLServer;
-
- /**
- * Expose the name of this transport on the prototype
- */
- SQLServer.prototype.name = 'sqlserver';
-
/**
- * Initialize a 'SQLServer' transport object with the given 'options'.
- *
- * Events:
- *
- *
+ * @constructs SQLServer
* @param {Object} options
* @api private
*/
- function SQLServer(options) {
+ var SQLServer = exports.SQLServer = function(options) {
options = options || {};
winston.Transport.call(this, options);
@@ -34,13 +20,30 @@ var sql = require('node-sqlserver');
}
/**
- * Inherits from 'winston.Transport'
+ * @extends winston.Transport
*/
- util.Inherits(SQLServer, winston.Transport);
+ util.inherits(SQLServer, winston.Transport);
/**
- * Define a getter so that 'winston.transports.SQLServer' is available and thus backwards compatible
+ * Expose the name of this transport on the prototype
*/
- winston.transports.SQLServer = SQLServer;
+ SQLServer.prototype.name = 'sqlserver';
+
+/**
+ * Core Winston logging method
+ *
+ * @param {String} level to log at
+ * @param {String} message to log
+ * @param {object} metadata to attach to the messages
+ * @param {Function} callback to respond to when complete
+ * @api public
+ */
+SQLServer.prototype.log = function (level, msg, meta, callback) {
+ if (this.silent) {
+ return callback && callback(null, true);
+ };
+
+ var self = this;
-
+ // TODO
+};

0 comments on commit 6299df4

Please sign in to comment.