dylang / logging

Lightweight informative modern console logging.
MIT License
54 stars 13 forks source link

createLogger is not a function #15

Closed FruitSnack1 closed 8 months ago

FruitSnack1 commented 1 year ago

Got TypeError: createLogger is not a function in javascript. Same code works in typescript tho.

Code:

import createLogger from 'logging';

const logger = createLogger('FeatureName');

logger.info('Interesting');

logging 3.3.0 nodejs 16.15.1

shehryardev commented 8 months ago

@FruitSnack1 Instead, try this.

import createLogger from 'logging';
const logger = createLogger.default("FeatureName");
FruitSnack1 commented 8 months ago

Thanks mate, Its a year late but that fixed it. 😂