Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
0ee2b8295a | |||
4fd4de20c2 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartlog",
|
"name": "@pushrocks/smartlog",
|
||||||
"version": "1.0.6",
|
"version": "2.0.0",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartlog",
|
"name": "@pushrocks/smartlog",
|
||||||
"version": "1.0.6",
|
"version": "2.0.0",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "winston based logger for large scale projects",
|
"description": "winston based logger for large scale projects",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -4,7 +4,7 @@ import * as smartlog from '../ts/index';
|
|||||||
let defaultLogger: smartlog.Smartlog;
|
let defaultLogger: smartlog.Smartlog;
|
||||||
|
|
||||||
tap.test('should produce instance of Smartlog', async () => {
|
tap.test('should produce instance of Smartlog', async () => {
|
||||||
defaultLogger = smartlog.getDefaultLogger();
|
defaultLogger = smartlog.defaultLogger;
|
||||||
expect(defaultLogger).to.be.instanceOf(smartlog.Smartlog);
|
expect(defaultLogger).to.be.instanceOf(smartlog.Smartlog);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
11
ts/index.ts
11
ts/index.ts
@ -1,13 +1,6 @@
|
|||||||
import * as plugins from './smartlog.plugins';
|
import * as plugins from './smartlog.plugins';
|
||||||
import { Smartlog } from './smartlog.classes.smartlog';
|
import { Smartlog } from './smartlog.classes.smartlog';
|
||||||
|
const defaultLogger: Smartlog = new Smartlog();
|
||||||
|
|
||||||
export { Smartlog };
|
export { Smartlog, defaultLogger };
|
||||||
|
|
||||||
let defaultLogger: Smartlog;
|
|
||||||
|
|
||||||
export const getDefaultLogger = () => {
|
|
||||||
if (!defaultLogger) {
|
|
||||||
defaultLogger = new Smartlog();
|
|
||||||
}
|
|
||||||
return defaultLogger;
|
|
||||||
};
|
|
||||||
|
Reference in New Issue
Block a user