1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-08-09 10:42:50 +00:00

Receivers: Added unified logger module

This commit is contained in:
Michael Hollister 2025-05-01 10:37:21 -05:00
parent 7f9d7939bc
commit b24b3f0c55
17 changed files with 351 additions and 117 deletions

View file

@ -1,5 +1,7 @@
import mdns from 'modules/mdns-js';
import { Main, getComputerName } from 'src/Main';
import { Logger, LoggerType } from 'common/Logger';
import { getComputerName } from 'src/Main';
const logger = new Logger('DiscoveryService', LoggerType.BACKEND);
export class DiscoveryService {
private serviceTcp: any;
@ -11,13 +13,7 @@ export class DiscoveryService {
}
const name = `FCast-${getComputerName()}`;
// Cannot reference Main during static class initialization
// @ts-ignore
if (TARGET === 'webOS') {
console.log(`Discovery service started: ${name}`);
} else {
Main.logger.info(`Discovery service started: ${name}`);
}
logger.info(`Discovery service started: ${name}`);
this.serviceTcp = mdns.createAdvertisement(mdns.tcp('_fcast'), 46899, { name: name });
this.serviceTcp.start();