mirror of
https://github.com/streamwall/streamwall.git
synced 2026-04-03 20:32:08 -04:00
Remove console debug statements
This commit is contained in:
@@ -218,10 +218,7 @@ async function main(argv) {
|
|||||||
callback(false)
|
callback(false)
|
||||||
})
|
})
|
||||||
|
|
||||||
console.debug('Loading persistence data...')
|
|
||||||
const persistData = await persistence.load()
|
const persistData = await persistence.load()
|
||||||
|
|
||||||
console.debug('Creating StreamWindow...')
|
|
||||||
const idGen = new StreamIDGenerator()
|
const idGen = new StreamIDGenerator()
|
||||||
const localStreamData = new LocalStreamData()
|
const localStreamData = new LocalStreamData()
|
||||||
const overlayStreamData = new LocalStreamData()
|
const overlayStreamData = new LocalStreamData()
|
||||||
@@ -237,7 +234,6 @@ async function main(argv) {
|
|||||||
})
|
})
|
||||||
streamWindow.init()
|
streamWindow.init()
|
||||||
|
|
||||||
console.debug('Creating Auth...')
|
|
||||||
const auth = new Auth({
|
const auth = new Auth({
|
||||||
adminUsername: argv.control.username,
|
adminUsername: argv.control.username,
|
||||||
adminPassword: argv.control.password,
|
adminPassword: argv.control.password,
|
||||||
@@ -249,7 +245,6 @@ async function main(argv) {
|
|||||||
let twitchBot = null
|
let twitchBot = null
|
||||||
let streamdelayClient = null
|
let streamdelayClient = null
|
||||||
|
|
||||||
console.debug('Creating initial state...')
|
|
||||||
let clientState = new StateWrapper({
|
let clientState = new StateWrapper({
|
||||||
config: {
|
config: {
|
||||||
width: argv.window.width,
|
width: argv.window.width,
|
||||||
@@ -294,29 +289,21 @@ async function main(argv) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const onMessage = async (msg, respond) => {
|
const onMessage = async (msg, respond) => {
|
||||||
console.debug('Received message:', msg)
|
|
||||||
if (msg.type === 'set-listening-view') {
|
if (msg.type === 'set-listening-view') {
|
||||||
console.debug('Setting listening view:', msg.viewIdx)
|
|
||||||
streamWindow.setListeningView(msg.viewIdx)
|
streamWindow.setListeningView(msg.viewIdx)
|
||||||
} else if (msg.type === 'set-view-background-listening') {
|
} else if (msg.type === 'set-view-background-listening') {
|
||||||
console.debug('Setting view background listening:', msg.viewIdx, msg.listening)
|
|
||||||
streamWindow.setViewBackgroundListening(msg.viewIdx, msg.listening)
|
streamWindow.setViewBackgroundListening(msg.viewIdx, msg.listening)
|
||||||
} else if (msg.type === 'set-view-blurred') {
|
} else if (msg.type === 'set-view-blurred') {
|
||||||
console.debug('Setting view blurred:', msg.viewIdx, msg.blurred)
|
|
||||||
streamWindow.setViewBlurred(msg.viewIdx, msg.blurred)
|
streamWindow.setViewBlurred(msg.viewIdx, msg.blurred)
|
||||||
} else if (msg.type === 'rotate-stream') {
|
} else if (msg.type === 'rotate-stream') {
|
||||||
console.debug('Rotating stream:', msg.url, msg.rotation)
|
|
||||||
overlayStreamData.update(msg.url, {
|
overlayStreamData.update(msg.url, {
|
||||||
rotation: msg.rotation,
|
rotation: msg.rotation,
|
||||||
})
|
})
|
||||||
} else if (msg.type === 'update-custom-stream') {
|
} else if (msg.type === 'update-custom-stream') {
|
||||||
console.debug('Updating custom stream:', msg.url)
|
|
||||||
localStreamData.update(msg.url, msg.data)
|
localStreamData.update(msg.url, msg.data)
|
||||||
} else if (msg.type === 'delete-custom-stream') {
|
} else if (msg.type === 'delete-custom-stream') {
|
||||||
console.debug('Deleting custom stream:', msg.url)
|
|
||||||
localStreamData.delete(msg.url)
|
localStreamData.delete(msg.url)
|
||||||
} else if (msg.type === 'reload-view') {
|
} else if (msg.type === 'reload-view') {
|
||||||
console.debug('Reloading view:', msg.viewIdx)
|
|
||||||
streamWindow.reloadView(msg.viewIdx)
|
streamWindow.reloadView(msg.viewIdx)
|
||||||
} else if (msg.type === 'browse' || msg.type === 'dev-tools') {
|
} else if (msg.type === 'browse' || msg.type === 'dev-tools') {
|
||||||
if (
|
if (
|
||||||
@@ -339,7 +326,6 @@ async function main(argv) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (msg.type === 'browse') {
|
if (msg.type === 'browse') {
|
||||||
console.debug('Attempting to browse URL:', msg.url)
|
|
||||||
try {
|
try {
|
||||||
ensureValidURL(msg.url)
|
ensureValidURL(msg.url)
|
||||||
browseWindow.loadURL(msg.url)
|
browseWindow.loadURL(msg.url)
|
||||||
@@ -348,17 +334,13 @@ async function main(argv) {
|
|||||||
console.error('Error:', error)
|
console.error('Error:', error)
|
||||||
}
|
}
|
||||||
} else if (msg.type === 'dev-tools') {
|
} else if (msg.type === 'dev-tools') {
|
||||||
console.debug('Opening DevTools for view:', msg.viewIdx)
|
|
||||||
streamWindow.openDevTools(msg.viewIdx, browseWindow.webContents)
|
streamWindow.openDevTools(msg.viewIdx, browseWindow.webContents)
|
||||||
}
|
}
|
||||||
} else if (msg.type === 'set-stream-censored' && streamdelayClient) {
|
} else if (msg.type === 'set-stream-censored' && streamdelayClient) {
|
||||||
console.debug('Setting stream censored:', msg.isCensored)
|
|
||||||
streamdelayClient.setCensored(msg.isCensored)
|
streamdelayClient.setCensored(msg.isCensored)
|
||||||
} else if (msg.type === 'set-stream-running' && streamdelayClient) {
|
} else if (msg.type === 'set-stream-running' && streamdelayClient) {
|
||||||
console.debug('Setting stream running:', msg.isStreamRunning)
|
|
||||||
streamdelayClient.setStreamRunning(msg.isStreamRunning)
|
streamdelayClient.setStreamRunning(msg.isStreamRunning)
|
||||||
} else if (msg.type === 'create-invite') {
|
} else if (msg.type === 'create-invite') {
|
||||||
console.debug('Creating invite for role:', msg.role)
|
|
||||||
const { secret } = await auth.createToken({
|
const { secret } = await auth.createToken({
|
||||||
kind: 'invite',
|
kind: 'invite',
|
||||||
role: msg.role,
|
role: msg.role,
|
||||||
@@ -366,7 +348,6 @@ async function main(argv) {
|
|||||||
})
|
})
|
||||||
respond({ name: msg.name, secret })
|
respond({ name: msg.name, secret })
|
||||||
} else if (msg.type === 'delete-token') {
|
} else if (msg.type === 'delete-token') {
|
||||||
console.debug('Deleting token:', msg.tokenId)
|
|
||||||
auth.deleteToken(msg.tokenId)
|
auth.deleteToken(msg.tokenId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -380,9 +361,7 @@ async function main(argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (argv.control.address) {
|
if (argv.control.address) {
|
||||||
console.debug('Initializing web server...')
|
|
||||||
const webDistPath = path.join(app.getAppPath(), './.webpack/main/web')
|
const webDistPath = path.join(app.getAppPath(), './.webpack/main/web')
|
||||||
console.debug('Web dist path:', webDistPath)
|
|
||||||
await initWebServer({
|
await initWebServer({
|
||||||
certDir: argv.cert.dir,
|
certDir: argv.cert.dir,
|
||||||
certProduction: argv.cert.production,
|
certProduction: argv.cert.production,
|
||||||
@@ -403,7 +382,6 @@ async function main(argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (argv.streamdelay.key) {
|
if (argv.streamdelay.key) {
|
||||||
console.debug('Setting up Streamdelay client...')
|
|
||||||
streamdelayClient = new StreamdelayClient({
|
streamdelayClient = new StreamdelayClient({
|
||||||
endpoint: argv.streamdelay.endpoint,
|
endpoint: argv.streamdelay.endpoint,
|
||||||
key: argv.streamdelay.key,
|
key: argv.streamdelay.key,
|
||||||
@@ -415,7 +393,6 @@ async function main(argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (argv.twitch.token) {
|
if (argv.twitch.token) {
|
||||||
console.debug('Setting up Twitch bot...')
|
|
||||||
twitchBot = new TwitchBot(argv.twitch)
|
twitchBot = new TwitchBot(argv.twitch)
|
||||||
twitchBot.on('setListeningView', (idx) => {
|
twitchBot.on('setListeningView', (idx) => {
|
||||||
streamWindow.setListeningView(idx)
|
streamWindow.setListeningView(idx)
|
||||||
@@ -438,11 +415,9 @@ async function main(argv) {
|
|||||||
|
|
||||||
const dataSources = [
|
const dataSources = [
|
||||||
...argv.data['json-url'].map((url) => {
|
...argv.data['json-url'].map((url) => {
|
||||||
console.debug('Setting data source from json-url:', url)
|
|
||||||
return markDataSource(pollDataURL(url, argv.data.interval), 'json-url')
|
return markDataSource(pollDataURL(url, argv.data.interval), 'json-url')
|
||||||
}),
|
}),
|
||||||
...argv.data['toml-file'].map((path) => {
|
...argv.data['toml-file'].map((path) => {
|
||||||
console.debug('Setting data source from toml-file:', path)
|
|
||||||
return markDataSource(watchDataFile(path), 'toml-file')
|
return markDataSource(watchDataFile(path), 'toml-file')
|
||||||
}),
|
}),
|
||||||
markDataSource(localStreamData.gen(), 'custom'),
|
markDataSource(localStreamData.gen(), 'custom'),
|
||||||
@@ -450,29 +425,24 @@ async function main(argv) {
|
|||||||
]
|
]
|
||||||
|
|
||||||
for await (const rawStreams of combineDataSources(dataSources)) {
|
for await (const rawStreams of combineDataSources(dataSources)) {
|
||||||
console.debug('Processing streams:', rawStreams)
|
|
||||||
const streams = idGen.process(rawStreams)
|
const streams = idGen.process(rawStreams)
|
||||||
updateState({ streams })
|
updateState({ streams })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
console.debug('Parsing command line arguments...')
|
|
||||||
const argv = parseArgs()
|
const argv = parseArgs()
|
||||||
if (argv.help) {
|
if (argv.help) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug('Initializing Sentry...')
|
|
||||||
if (argv.telemetry.sentry) {
|
if (argv.telemetry.sentry) {
|
||||||
Sentry.init({ dsn: SENTRY_DSN })
|
Sentry.init({ dsn: SENTRY_DSN })
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug('Setting up Electron...')
|
|
||||||
app.commandLine.appendSwitch('high-dpi-support', 1)
|
app.commandLine.appendSwitch('high-dpi-support', 1)
|
||||||
app.commandLine.appendSwitch('force-device-scale-factor', 1)
|
app.commandLine.appendSwitch('force-device-scale-factor', 1)
|
||||||
|
|
||||||
console.debug('Enabling Electron sandbox...')
|
|
||||||
app.enableSandbox()
|
app.enableSandbox()
|
||||||
app
|
app
|
||||||
.whenReady()
|
.whenReady()
|
||||||
@@ -484,6 +454,5 @@ function init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (require.main === module) {
|
if (require.main === module) {
|
||||||
console.debug('Starting Streamwall...')
|
|
||||||
init()
|
init()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -244,7 +244,6 @@ export default async function initWebServer({
|
|||||||
onMessage,
|
onMessage,
|
||||||
stateDoc,
|
stateDoc,
|
||||||
}) {
|
}) {
|
||||||
console.debug('Parsing URL:', baseURL)
|
|
||||||
let { protocol, hostname, port } = new URL(baseURL)
|
let { protocol, hostname, port } = new URL(baseURL)
|
||||||
if (!port) {
|
if (!port) {
|
||||||
port = protocol === 'https:' ? 443 : 80
|
port = protocol === 'https:' ? 443 : 80
|
||||||
@@ -253,7 +252,6 @@ export default async function initWebServer({
|
|||||||
port = overridePort
|
port = overridePort
|
||||||
}
|
}
|
||||||
|
|
||||||
console.debug('Initializing web server:', { hostname, port })
|
|
||||||
const { app } = initApp({
|
const { app } = initApp({
|
||||||
auth,
|
auth,
|
||||||
baseURL,
|
baseURL,
|
||||||
@@ -264,17 +262,6 @@ export default async function initWebServer({
|
|||||||
stateDoc,
|
stateDoc,
|
||||||
})
|
})
|
||||||
|
|
||||||
console.debug(`App initialized with args:`, {
|
|
||||||
certDir,
|
|
||||||
certProduction,
|
|
||||||
email,
|
|
||||||
baseURL,
|
|
||||||
overrideHostname,
|
|
||||||
overridePort,
|
|
||||||
webDistPath,
|
|
||||||
logEnabled,
|
|
||||||
})
|
|
||||||
|
|
||||||
let server
|
let server
|
||||||
if (protocol === 'https:' && certDir) {
|
if (protocol === 'https:' && certDir) {
|
||||||
const { key, cert } = await simpleCert({
|
const { key, cert } = await simpleCert({
|
||||||
@@ -288,12 +275,9 @@ export default async function initWebServer({
|
|||||||
} else {
|
} else {
|
||||||
server = http.createServer(app.callback())
|
server = http.createServer(app.callback())
|
||||||
}
|
}
|
||||||
console.debug("Server started.")
|
|
||||||
|
|
||||||
const listen = promisify(server.listen).bind(server)
|
const listen = promisify(server.listen).bind(server)
|
||||||
await listen(port, overrideHostname || hostname)
|
await listen(port, overrideHostname || hostname)
|
||||||
|
|
||||||
console.debug('Web server listening:', { hostname, port })
|
|
||||||
|
|
||||||
return { server }
|
return { server }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user