Skip to content

Commit

Permalink
Fix debug namespaces
Browse files Browse the repository at this point in the history
Summary: @​public
Have a top-level debug namespace: `ReactNativePackager`
And add a couple of debugs in the transformer. This is ground work for adding a verbose option.

Reviewed By: @DmitrySoshnikov

Differential Revision: D2489960
  • Loading branch information
Amjad Masad authored and facebook-github-bot-4 committed Sep 29, 2015
1 parent b903754 commit 42b5cd5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const Activity = require('../../Activity');
const AssetModule_DEPRECATED = require('../AssetModule_DEPRECATED');
const Fastfs = require('../fastfs');
const debug = require('debug')('ReactPackager:DependencyGraph');
const debug = require('debug')('ReactNativePackager:DependencyGraph');
const path = require('path');

class DeprecatedAssetMap {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
'use strict';

const debug = require('debug')('ReactPackager:DependencyGraph');
const debug = require('debug')('ReactNativePackager:DependencyGraph');
const util = require('util');
const path = require('path');
const isAbsolutePath = require('absolute-path');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const Promise = require('promise');
const debug = require('debug')('DependencyGraph');
const debug = require('debug')('ReactNativePackager:DependencyGraph');
const fs = require('fs');
const path = require('path');

Expand Down
5 changes: 5 additions & 0 deletions packager/react-packager/src/JSTransformer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const declareOpts = require('../lib/declareOpts');
const fs = require('fs');
const util = require('util');
const workerFarm = require('worker-farm');
const debug = require('debug')('ReactNativePackager:JStransformer');

const readFile = Promise.denodeify(fs.readFile);

Expand Down Expand Up @@ -86,6 +87,8 @@ class Transformer {
return Promise.reject(new Error('No transfrom module'));
}

debug('transforming file', filePath);

return this._cache.get(
filePath,
'transformedSource',
Expand All @@ -107,6 +110,8 @@ class Transformer {
throw formatError(res.error, filePath);
}

debug('done transforming file', filePath);

return new ModuleTransport({
code: res.code,
map: res.map,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const Bundle = require('../Bundler/Bundle');
const Promise = require('promise');
const bser = require('bser');
const debug = require('debug')('ReactPackager:SocketClient');
const debug = require('debug')('ReactNativePackager:SocketClient');
const fs = require('fs');
const net = require('net');
const path = require('path');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
const Promise = require('promise');
const Server = require('../Server');
const bser = require('bser');
const debug = require('debug')('ReactPackager:SocketServer');
const debug = require('debug')('ReactNativePackager:SocketServer');
const fs = require('fs');
const net = require('net');

Expand Down
4 changes: 2 additions & 2 deletions packager/react-packager/src/SocketInterface/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const SocketClient = require('./SocketClient');
const SocketServer = require('./SocketServer');
const _ = require('underscore');
const crypto = require('crypto');
const debug = require('debug')('ReactPackager:SocketInterface');
const debug = require('debug')('ReactNativePackager:SocketInterface');
const fs = require('fs');
const net = require('net');
const path = require('path');
Expand Down Expand Up @@ -90,7 +90,7 @@ function createServer(resolve, reject, options, sockPath) {

// Enable server debugging by default since it's going to a log file.
const env = _.clone(process.env);
env.DEBUG = 'ReactPackager:SocketServer';
env.DEBUG = 'ReactNativePackager:SocketServer';

// We have to go through the main entry point to make sure
// we go through the babel require hook.
Expand Down

0 comments on commit 42b5cd5

Please sign in to comment.