Don't require log4js in bin/*

This commit is contained in:
Mark Cavage 2011-11-22 13:36:08 -08:00
parent e9c1de31f9
commit dc8d04e8e0
6 changed files with 19 additions and 5 deletions

View File

@ -6,7 +6,6 @@ var fs = require('fs');
var path = require('path'); var path = require('path');
var url = require('url'); var url = require('url');
var log4js = require('log4js');
var nopt = require('nopt'); var nopt = require('nopt');
var ldap = require('../lib/index'); var ldap = require('../lib/index');
@ -15,6 +14,8 @@ var ldap = require('../lib/index');
///--- Globals ///--- Globals
var log4js = ldap.log4js;
nopt.typeDefs.DN = { nopt.typeDefs.DN = {
type: ldap.DN, type: ldap.DN,
validate: function(data, k, val) { validate: function(data, k, val) {

View File

@ -6,7 +6,6 @@ var fs = require('fs');
var path = require('path'); var path = require('path');
var url = require('url'); var url = require('url');
var log4js = require('log4js');
var nopt = require('nopt'); var nopt = require('nopt');
var ldap = require('../lib/index'); var ldap = require('../lib/index');
@ -15,6 +14,8 @@ var ldap = require('../lib/index');
///--- Globals ///--- Globals
var log4js = ldap.log4js;
nopt.typeDefs.DN = { nopt.typeDefs.DN = {
type: ldap.DN, type: ldap.DN,
validate: function(data, k, val) { validate: function(data, k, val) {

View File

@ -6,7 +6,6 @@ var fs = require('fs');
var path = require('path'); var path = require('path');
var url = require('url'); var url = require('url');
var log4js = require('log4js');
var nopt = require('nopt'); var nopt = require('nopt');
var ldap = require('../lib/index'); var ldap = require('../lib/index');
@ -15,6 +14,8 @@ var ldap = require('../lib/index');
///--- Globals ///--- Globals
var log4js = ldap.log4js;
nopt.typeDefs.DN = { nopt.typeDefs.DN = {
type: ldap.DN, type: ldap.DN,
validate: function(data, k, val) { validate: function(data, k, val) {

View File

@ -6,7 +6,6 @@ var fs = require('fs');
var path = require('path'); var path = require('path');
var url = require('url'); var url = require('url');
var log4js = require('log4js');
var nopt = require('nopt'); var nopt = require('nopt');
var ldap = require('../lib/index'); var ldap = require('../lib/index');
@ -15,6 +14,8 @@ var ldap = require('../lib/index');
///--- Globals ///--- Globals
var log4js = ldap.log4js;
nopt.typeDefs.DN = { nopt.typeDefs.DN = {
type: ldap.DN, type: ldap.DN,
validate: function(data, k, val) { validate: function(data, k, val) {

View File

@ -5,7 +5,6 @@
var path = require('path'); var path = require('path');
var url = require('url'); var url = require('url');
var log4js = require('log4js');
var nopt = require('nopt'); var nopt = require('nopt');
var ldap = require('../lib/index'); var ldap = require('../lib/index');
@ -14,6 +13,8 @@ var ldap = require('../lib/index');
///--- Globals ///--- Globals
var log4js = ldap.log4js;
nopt.typeDefs.DN = { nopt.typeDefs.DN = {
type: ldap.DN, type: ldap.DN,
validate: function(data, k, val) { validate: function(data, k, val) {

View File

@ -130,6 +130,7 @@ Log.prototype.fatal = function() {
module.exports = { module.exports = {
setLevel: function(l) { setLevel: function(l) {
l = l.charAt(0).toUpperCase() + l.slice(1).toLowerCase();
if (LEVELS[l] !== undefined) if (LEVELS[l] !== undefined)
level = l; level = l;
@ -141,6 +142,14 @@ module.exports = {
throw new TypeError('name (string) required'); throw new TypeError('name (string) required');
return new Log(name); return new Log(name);
},
setGlobalLogLevel: function(l) {
l = l.charAt(0).toUpperCase() + l.slice(1).toLowerCase();
if (LEVELS[l] !== undefined)
level = l;
return level;
} }
}; };