How to use @cdm-logger/client - 3 common examples

To help you get started, we’ve selected a few @cdm-logger/client 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 cdmbase / fullstack-pro / servers / frontend-server / src / config / apollo-client.ts View on Github external
connectionCallback: async (error) => {
                if (error) {
                    logger.trace('[connectionCallback error] %j', error);
                    // error.message has to match what the server returns.
                    if ((error as any).message === 'TokenExpired') {
                        console.log('onTokenError about to call');
                        // Reset the WS connection for it to carry the new JWT.
                        (wsLink as any).subscriptionClient.close(false, false);
                    }
                }
            },
        },
github cdmbase / fullstack-pro / packages / sample-client-react / src / containers / ServerCounter.tsx View on Github external
props: ({ countData }: any) => {
        const newlog = logger.child({ childName: 'UIController' });
        newlog.debug('count data : (%j)', countData);
        return {
            subscribeToCount: params => {
                // logger.debug('count subscript data (%j)', params);
                return countData.subscribeToMore({
                    document: COUNT_SUBSCRIPTION,
                    variables: {},
                    updateQuery: (prev: any, { subscriptionData }) => {
                        const payload = subscriptionData.data && subscriptionData.data.subscribeToWorkspace;
                        if (!payload) {
                            return prev;
                        }
                        return payload;
                    },
                });
            },
github cdmbase / fullstack-pro / packages / sample-client-core / src / common / logger.ts View on Github external
import { ClientLogger } from '@cdm-logger/client';

const logLevel = process.env.LOG_LEVEL || 'trace';
const logger = ClientLogger.create('FullStack', { level: logLevel });

export { logger };

@cdm-logger/client

Universal - Logger

MIT
Latest version published 5 months ago

Package Health Score

53 / 100
Full package analysis