#2 implement debugger

This commit is contained in:
Logan Cusano
2024-06-02 20:10:55 -04:00
parent e54c80a95b
commit f706ac89b4
15 changed files with 190 additions and 94 deletions

View File

@@ -1,3 +1,5 @@
import { DebugBuilder } from "../../modules/debugger.mjs";
const log = new DebugBuilder("client", "op25ConfigGenerator");
import { promises as fs } from 'fs';
class OP25ConfigObject {
@@ -7,9 +9,9 @@ class OP25ConfigObject {
try {
const jsonConfig = JSON.stringify(this, null, 2);
await fs.writeFile(filename, jsonConfig);
console.log(`Config exported to ${filename}`);
log.INFO(`Config exported to ${filename}`);
} catch (error) {
console.error(`Error exporting config to ${filename}: ${error}`);
log.ERROR(`Error exporting config to ${filename}: ${error}`);
}
}
}
@@ -17,7 +19,7 @@ class OP25ConfigObject {
export class P25ConfigGenerator extends OP25ConfigObject {
constructor({ systemName, controlChannels, tagsFile, whitelistFile = undefined }) {
super();
console.log("Generating P25 Config for:", systemName);
log.INFO("Generating P25 Config for:", systemName);
const controlChannelsString = controlChannels.join(',');
this.channels = [new channelConfig({
"channelName": systemName,