Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

Commit 0a818ba

Browse files
committed
add some debug logging to config
1 parent 6fe5a17 commit 0a818ba

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/config/src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import TruffleError from "@truffle/error";
66
import originalRequire from "original-require";
77
import { getInitialConfig, configProps } from "./configDefaults";
88
import { EventManager } from "@truffle/events";
9+
import debugModule from "debug";
10+
const debug = debugModule("config");
911

1012
const DEFAULT_CONFIG_FILENAME = "truffle-config.js";
1113
const BACKUP_CONFIG_FILENAME = "truffle.js"; // old config filename
@@ -116,6 +118,7 @@ class TruffleConfig {
116118
if (typeof clone[key] === "object" && this._deepCopy.includes(key)) {
117119
this[key] = merge(this[key], clone[key]);
118120
} else {
121+
debug("setting key -- %o -- to -- %o", key, clone[key]);
119122
this[key] = clone[key];
120123
}
121124
} catch (e) {
@@ -161,6 +164,7 @@ class TruffleConfig {
161164
}
162165

163166
public static detect(options: any = {}, filename?: string): TruffleConfig {
167+
debug("callling Config.detect with filename -- %o", filename);
164168
let configFile;
165169
const configPath = options.config;
166170

@@ -180,13 +184,15 @@ class TruffleConfig {
180184
}
181185

182186
public static load(file: string, options: any = {}): TruffleConfig {
187+
debug("calling Config.load with file -- %o", file);
183188
const workingDirectory = options.config
184189
? process.cwd()
185190
: path.dirname(path.resolve(file));
186191

187192
const config = new TruffleConfig(undefined, workingDirectory, undefined);
188193

189194
const staticConfig = originalRequire(file);
195+
debug("the static config is -- %o", staticConfig);
190196

191197
config.merge(staticConfig);
192198
config.merge(options);

0 commit comments

Comments
 (0)