Skip to content

Commit

Permalink
refactor(log): move log into new extern lib
Browse files Browse the repository at this point in the history
Refers to #382
  • Loading branch information
wzrdtales committed Jun 22, 2016
1 parent cea543c commit 0fb8ab4
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion api.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var index = require('./connect');
var Migration = require('./lib/migration.js');
var Seeder = require('./lib/seeder.js');
var Migrator = require('./lib/migrator.js');
var log = require('./lib/log');
var log = require('db-migrate-shared').log;
var pkginfo = require('pkginfo')(module, 'version'); // jshint ignore:line
var dotenv = require('dotenv');
var Promise = require('bluebird');
Expand Down
2 changes: 1 addition & 1 deletion bin/db-migrate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

var resolve = require( 'resolve' );
var log = require( '../lib/log.js' );
var log = require('db-migrate-shared').log;

process.title = 'db-migrate';

Expand Down
2 changes: 1 addition & 1 deletion connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var recursive = require('final-fs').readdirRecursive;
var fs = require('fs');
var driver = require('./lib/driver');
var path = require('path');
var log = require('./lib/log');
var log = require('db-migrate-shared').log;

var internals = {};

Expand Down
2 changes: 1 addition & 1 deletion lib/driver/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var internals = {};

internals.mod = internals.mod || {};
internals.mod.log = require('../log');
internals.mod.log = require('db-migrate-shared').log;
internals.mod.type = require('../data_type');
var Shadow = require('./shadow');
var log = internals.mod.log;
Expand Down
2 changes: 1 addition & 1 deletion lib/migration.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var fs = require('fs');
var path = require('path');
var log = require('./log');
var log = require('db-migrate-shared').log;
var Skeleton = require('./skeleton');

var filesRegEx = /\.js$/;
Expand Down
2 changes: 1 addition & 1 deletion lib/migrator.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var dbmUtil = require('./util');
var Migration = require('./migration');
var log = require('./log');
var log = require('db-migrate-shared').log;
var Promise = require('bluebird');
var MigratorInterface = require( './interface/migratorInterface.js');

Expand Down
2 changes: 1 addition & 1 deletion lib/relation.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var fs = require('fs'),
log = require('./log');
log = require('db-migrate-shared').log;

function Relation() {
this.relations = {};
Expand Down
2 changes: 1 addition & 1 deletion lib/seed.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var fs = require('fs');
var path = require('path');
var log = require('./log');
var log = require('db-migrate-shared').log;
var Skeleton = require('./skeleton');

var filesRegEx = /\.js$/;
Expand Down
2 changes: 1 addition & 1 deletion lib/seeder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var Seed = require('./seed');
var log = require('./log');
var log = require('db-migrate-shared').log;
var dbmUtil = require('./util');
var Promise = require('bluebird');
var SeederInterface = require( './interface/seederInterface.js');
Expand Down
2 changes: 1 addition & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var log = require('./log');
var log = require('db-migrate-shared').log;

function isIncludedInUp(migration, destination) {
if(!destination) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"dependencies": {
"async": "^1.0.0",
"bluebird": "^3.1.1",
"db-migrate-shared": "^1.0.2",
"dotenv": "~1.2.0",
"final-fs": "^1.6.0",
"mkdirp": "~0.5.0",
Expand Down
2 changes: 1 addition & 1 deletion test/driver/base_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var Base = require('db-migrate-base');
var internals = {
migrationTable: 'migrations',
mod: {
log: require('../../lib/log.js'),
log: require('db-migrate-shared').log,
type: require('../../lib/data_type.js')
}
};
Expand Down
2 changes: 1 addition & 1 deletion test/driver/mysql_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var assert = require('assert');
var dbmeta = require('db-meta');
var dataType = require('../../lib/data_type');
var driver = require('../../lib/driver');
var log = require('../..//lib/log.js');
var log = require('db-migrate-shared').log;

var config = require('../db.config.json').mysql;

Expand Down
2 changes: 1 addition & 1 deletion test/driver/pg_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert');
var dbmeta = require('db-meta');
var dataType = require('../../lib/data_type');
var driver = require('../../lib/driver');
var log = require('../..//lib/log.js');
var log = require('db-migrate-shared').log;

var config = require('../db.config.json').pg;

Expand Down

0 comments on commit 0fb8ab4

Please sign in to comment.