1.1.3 • Published 2 years ago

@ronald-fuchs/mbl-logger v1.1.3

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

MBL Logger

DB-Logger using MongoDB via Mongoose.

Usage

Use with Singleton instance

const logger = require('@ronald-fuchs/mbl-logger').Singleton.register("myScope");

async function doWithSingleton() {
    await logger.loadOrSetConfig({ logLevel: 'error' , logToConsole: true, logToFile: false }, false);
    const id = await logger.logError(1001, { msg: 'Test-Error' }, { user: 'John' });
    console.log(id);    
}

doWithSingleton();

Use with new instance

const logging = require('@ronald-fuchs/mbl-logger');
const logger = new logging.MblLogger();

async function doWithInstance() {
    const id = await logger.logWarning(1002, { msg: 'Test-Warning' }, { user: 'John' });
    console.log(id);
}

doWithInstance();

License

MIT license: https://mit-license.org/

1.1.1

2 years ago

1.1.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago