How to use the @microsoft/signalr.LogLevel function in @microsoft/signalr

To help you get started, we’ve selected a few @microsoft/signalr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github damienbod / AspNetCoreAngularSignalR / src / AspNetCoreAngularSignalR / angularApp / app / home / components / home.component.ts View on Github external
ngOnInit() {
        this._hubConnection = new signalR.HubConnectionBuilder()
            .withUrl('https://localhost:44324/loopy')
            .configureLogging(signalR.LogLevel.Trace)
            .build();

        this._hubConnection.start().catch(err => console.error(err.toString()));

        this._hubConnection.on('Send', (data: any) => {
            const received = `Received: ${data}`;
            this.messages.push(received);
        });
    }
github damienbod / AspNetCoreAngularSignalR / src / AspNetCoreAngularSignalR / angularApp / app / images / components / images.component.ts View on Github external
ngOnInit() {
        this._hubConnection = new signalR.HubConnectionBuilder()
            .withUrl('https://localhost:44324/zub')
            .configureLogging(signalR.LogLevel.Trace)
            .build();

        this._hubConnection.stop();

        this._hubConnection.start().catch(err => {
            console.error(err.toString());
        });

        this._hubConnection.on('ImageMessage', (data: any) => {
            console.log(data);
            this.images.push(data);
        });

    }
github damienbod / AspNetCoreAngularSignalR / src / AspNetCoreAngularSignalR / angularApp / app / news / news.service.ts View on Github external
private init() {

        this._hubConnection = new signalR.HubConnectionBuilder()
            .withUrl('https://localhost:44324/looney')
            .configureLogging(signalR.LogLevel.Information)
            .build();

        this._hubConnection.start().catch(err => console.error(err.toString()));

        this._hubConnection.on('Send', (newsItem: NewsItem) => {
            this.store.dispatch(new NewsActions.ReceivedItemAction(newsItem));
        });

        this._hubConnection.on('JoinGroup', (data: string) => {
            console.log('recieved data from the hub');
            console.log(data);
            this.store.dispatch(new NewsActions.ReceivedGroupJoinedAction(data));
        });

        this._hubConnection.on('LeaveGroup', (data: string) => {
            this.store.dispatch(new NewsActions.ReceivedGroupLeftAction(data));
github AndriySvyryd / UnicornHack / src / UnicornHack.Web / ClientApp / src / components / Game.tsx View on Github external
constructor(props: IGameProps) {
        super(props);

        const location = document.location || new Location();
        const connection = new signalR.HubConnectionBuilder()
            .withUrl(`${location.origin}/gameHub`,
                { transport: signalR.HttpTransportType.WebSockets, skipNegotiation: true })
            .configureLogging(signalR.LogLevel.Information)
            .withAutomaticReconnect()
            .withHubProtocol(new MessagePackHubProtocol())
            .build();

        connection.onclose = e => {
            if (e) {
              this.addError(`Connection closed with error: "${(e || '')}"`);
            } else {
                this.addMessage(MessageType.Info, 'Disconnected');
            }
        };

        connection.onreconnecting((e) => {
          this.addMessage(MessageType.Info, `Connection lost ("${e}"). Reconnecting.`);
        });