Remove console debug statements

This commit is contained in:
sayhiben
2025-01-19 23:19:50 -08:00
parent 5a792a505b
commit c58a4c3bd3
2 changed files with 0 additions and 47 deletions

View File

@@ -218,10 +218,7 @@ async function main(argv) {
callback(false)
})
console.debug('Loading persistence data...')
const persistData = await persistence.load()
console.debug('Creating StreamWindow...')
const idGen = new StreamIDGenerator()
const localStreamData = new LocalStreamData()
const overlayStreamData = new LocalStreamData()
@@ -237,7 +234,6 @@ async function main(argv) {
})
streamWindow.init()
console.debug('Creating Auth...')
const auth = new Auth({
adminUsername: argv.control.username,
adminPassword: argv.control.password,
@@ -249,7 +245,6 @@ async function main(argv) {
let twitchBot = null
let streamdelayClient = null
console.debug('Creating initial state...')
let clientState = new StateWrapper({
config: {
width: argv.window.width,
@@ -294,29 +289,21 @@ async function main(argv) {
})
const onMessage = async (msg, respond) => {
console.debug('Received message:', msg)
if (msg.type === 'set-listening-view') {
console.debug('Setting listening view:', msg.viewIdx)
streamWindow.setListeningView(msg.viewIdx)
} else if (msg.type === 'set-view-background-listening') {
console.debug('Setting view background listening:', msg.viewIdx, msg.listening)
streamWindow.setViewBackgroundListening(msg.viewIdx, msg.listening)
} else if (msg.type === 'set-view-blurred') {
console.debug('Setting view blurred:', msg.viewIdx, msg.blurred)
streamWindow.setViewBlurred(msg.viewIdx, msg.blurred)
} else if (msg.type === 'rotate-stream') {
console.debug('Rotating stream:', msg.url, msg.rotation)
overlayStreamData.update(msg.url, {
rotation: msg.rotation,
})
} else if (msg.type === 'update-custom-stream') {
console.debug('Updating custom stream:', msg.url)
localStreamData.update(msg.url, msg.data)
} else if (msg.type === 'delete-custom-stream') {
console.debug('Deleting custom stream:', msg.url)
localStreamData.delete(msg.url)
} else if (msg.type === 'reload-view') {
console.debug('Reloading view:', msg.viewIdx)
streamWindow.reloadView(msg.viewIdx)
} else if (msg.type === 'browse' || msg.type === 'dev-tools') {
if (
@@ -339,7 +326,6 @@ async function main(argv) {
})
}
if (msg.type === 'browse') {
console.debug('Attempting to browse URL:', msg.url)
try {
ensureValidURL(msg.url)
browseWindow.loadURL(msg.url)
@@ -348,17 +334,13 @@ async function main(argv) {
console.error('Error:', error)
}
} else if (msg.type === 'dev-tools') {
console.debug('Opening DevTools for view:', msg.viewIdx)
streamWindow.openDevTools(msg.viewIdx, browseWindow.webContents)
}
} else if (msg.type === 'set-stream-censored' && streamdelayClient) {
console.debug('Setting stream censored:', msg.isCensored)
streamdelayClient.setCensored(msg.isCensored)
} else if (msg.type === 'set-stream-running' && streamdelayClient) {
console.debug('Setting stream running:', msg.isStreamRunning)
streamdelayClient.setStreamRunning(msg.isStreamRunning)
} else if (msg.type === 'create-invite') {
console.debug('Creating invite for role:', msg.role)
const { secret } = await auth.createToken({
kind: 'invite',
role: msg.role,
@@ -366,7 +348,6 @@ async function main(argv) {
})
respond({ name: msg.name, secret })
} else if (msg.type === 'delete-token') {
console.debug('Deleting token:', msg.tokenId)
auth.deleteToken(msg.tokenId)
}
}
@@ -380,9 +361,7 @@ async function main(argv) {
}
if (argv.control.address) {
console.debug('Initializing web server...')
const webDistPath = path.join(app.getAppPath(), './.webpack/main/web')
console.debug('Web dist path:', webDistPath)
await initWebServer({
certDir: argv.cert.dir,
certProduction: argv.cert.production,
@@ -403,7 +382,6 @@ async function main(argv) {
}
if (argv.streamdelay.key) {
console.debug('Setting up Streamdelay client...')
streamdelayClient = new StreamdelayClient({
endpoint: argv.streamdelay.endpoint,
key: argv.streamdelay.key,
@@ -415,7 +393,6 @@ async function main(argv) {
}
if (argv.twitch.token) {
console.debug('Setting up Twitch bot...')
twitchBot = new TwitchBot(argv.twitch)
twitchBot.on('setListeningView', (idx) => {
streamWindow.setListeningView(idx)
@@ -438,11 +415,9 @@ async function main(argv) {
const dataSources = [
...argv.data['json-url'].map((url) => {
console.debug('Setting data source from json-url:', url)
return markDataSource(pollDataURL(url, argv.data.interval), 'json-url')
}),
...argv.data['toml-file'].map((path) => {
console.debug('Setting data source from toml-file:', path)
return markDataSource(watchDataFile(path), 'toml-file')
}),
markDataSource(localStreamData.gen(), 'custom'),
@@ -450,29 +425,24 @@ async function main(argv) {
]
for await (const rawStreams of combineDataSources(dataSources)) {
console.debug('Processing streams:', rawStreams)
const streams = idGen.process(rawStreams)
updateState({ streams })
}
}
function init() {
console.debug('Parsing command line arguments...')
const argv = parseArgs()
if (argv.help) {
return
}
console.debug('Initializing Sentry...')
if (argv.telemetry.sentry) {
Sentry.init({ dsn: SENTRY_DSN })
}
console.debug('Setting up Electron...')
app.commandLine.appendSwitch('high-dpi-support', 1)
app.commandLine.appendSwitch('force-device-scale-factor', 1)
console.debug('Enabling Electron sandbox...')
app.enableSandbox()
app
.whenReady()
@@ -484,6 +454,5 @@ function init() {
}
if (require.main === module) {
console.debug('Starting Streamwall...')
init()
}

View File

@@ -244,7 +244,6 @@ export default async function initWebServer({
onMessage,
stateDoc,
}) {
console.debug('Parsing URL:', baseURL)
let { protocol, hostname, port } = new URL(baseURL)
if (!port) {
port = protocol === 'https:' ? 443 : 80
@@ -253,7 +252,6 @@ export default async function initWebServer({
port = overridePort
}
console.debug('Initializing web server:', { hostname, port })
const { app } = initApp({
auth,
baseURL,
@@ -264,17 +262,6 @@ export default async function initWebServer({
stateDoc,
})
console.debug(`App initialized with args:`, {
certDir,
certProduction,
email,
baseURL,
overrideHostname,
overridePort,
webDistPath,
logEnabled,
})
let server
if (protocol === 'https:' && certDir) {
const { key, cert } = await simpleCert({
@@ -288,12 +275,9 @@ export default async function initWebServer({
} else {
server = http.createServer(app.callback())
}
console.debug("Server started.")
const listen = promisify(server.listen).bind(server)
await listen(port, overrideHostname || hostname)
console.debug('Web server listening:', { hostname, port })
return { server }
}