Skip to content

Commit 02ced3a

Browse files
TundraWorkITJesse
authored andcommitted
merge
1 parent e460fb7 commit 02ced3a

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

ns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if (config.render.advancements) {
2929
}
3030

3131
const output = path.join(config.BASEPATH, config.render.output);
32-
console.log('[INFO] CREATE:', output);
32+
console.log('[INFO] CREATE OUTPUT DIR:', output);
3333

3434
(async () => {
3535
const prompt = new Confirm('Do you want to clean the output folder?');

utils.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default class Utils {
2929
try {
3030
config = yaml.safeLoad(fs.readFileSync('./config.yml'), 'utf8');
3131
} catch (e) {
32-
console.error('[ERROR] CONFIGURATION:', e.code);
32+
console.error('[ERROR][LoadConfig] CONFIGURATION:', e.code);
3333
process.exit(1);
3434
}
3535
config.BASEPATH = path.parse(path.resolve('./config.yml')).dir;
@@ -87,9 +87,10 @@ export default class Utils {
8787
try {
8888
data = fs.readFileSync(statsfile);
8989
} catch (error) {
90-
console.log('[ERROR] READ:', statsfile);
90+
console.error('[ERROR][PlayerData] READ:', statsfile, error);
9191
return reject();
9292
}
93+
console.log('[INFO][PlayerData] READ:', statsfile);
9394
return resolve(JSON.parse(data));
9495
});
9596
}
@@ -104,9 +105,10 @@ export default class Utils {
104105
try {
105106
data = fs.readFileSync(advancementsfile);
106107
} catch (error) {
107-
console.log('[ERROR] READ:', advancementsfile);
108+
console.error('[ERROR][PlayerData] READ:', advancementsfile, error);
108109
return reject();
109110
}
111+
console.log('[INFO][PlayerData] READ:', advancementsfile);
110112
return resolve(JSON.parse(data));
111113
});
112114
}
@@ -117,10 +119,10 @@ export default class Utils {
117119
const nbt = new NBT();
118120
nbt.loadFromZlibCompressedFile(datafile, async (err) => {
119121
if (err) {
120-
console.error('[ERROR] READ:', datafile);
122+
console.error('[ERROR][PlayerData] READ:', datafile, err);
121123
return reject();
122124
}
123-
console.log('[INFO] PARSE:', datafile);
125+
console.log('[INFO][PlayerData] PARSE NBT:', datafile);
124126
const uuidShort = uuid.replace(/-/g, '');
125127
let history;
126128
try {
@@ -197,7 +199,7 @@ export default class Utils {
197199
return this.getMojangAPI(apiPath);
198200
}
199201
this.apiLimited = true;
200-
console.log('[INFO] API REQUEST:', apiPath);
202+
console.log('[INFO][MojangAPI] API REQUEST:', path);
201203

202204
let body;
203205
try {
@@ -206,7 +208,7 @@ export default class Utils {
206208
...reqOpts,
207209
});
208210
} catch (err) {
209-
console.error('[ERROR] API REQUEST:', apiPath, err);
211+
console.error('[ERROR][MojangAPI] API REQUEST:', path, err);
210212
setTimeout(() => {
211213
this.apiLimited = false;
212214
}, this.config.api.ratelimit * 3000);
@@ -270,21 +272,21 @@ export default class Utils {
270272
}
271273

272274
static download(apiPath, dest) {
273-
console.log('[INFO] DOWNLOAD:', apiPath);
275+
console.log('[INFO][ASSETS] DOWNLOAD:', path);
274276
request
275277
.get(apiPath)
276278
.on('error', (err) => {
277-
console.error('[ERROR] DOWNLOAD:', apiPath, err);
279+
console.error('[ERROR][ASSETS] DOWNLOAD:', path, err);
278280
})
279281
.pipe(fs.createWriteStream(dest));
280282
}
281283

282284
static writeJSON(dest, data) {
283285
fs.writeFile(dest, JSON.stringify(data), (err) => {
284286
if (err) {
285-
console.log('[ERROR] CREATE:', dest);
287+
console.error('[ERROR][WriteJSON] CREATE:', dest, err);
286288
} else {
287-
console.log('[INFO] CREATE:', dest);
289+
console.log('[INFO][WriteJSON] CREATE:', dest);
288290
}
289291
});
290292
}

0 commit comments

Comments
 (0)