log4browser
This is a simple log tool for usage in browser.
Dont like Java or the other language, we lack good log tool in browser environment, which can help us trace errors or problems more efficiently.
So this is what log4browser try to do.
Welcome to develop together or put an issue.
Installation
npm install log4browser
Usage
1.create instance
// Common JSvar log4browser = ;var logger = ;
// Or in ES Modules;var logger = ;
2.init with your own config
var config = projectIdentifier: '' captureJsError: true captureResourceError: true captureAjaxError: true captureConsoleError: false isAutoHandle: true // if true, logger will call errorHandler automatically isEnableBuffer: false // if true, logger will create a buffer pool and save the concurrency info bufferCapacity: 10 // the capacity of buffer pool { // something to do with logData };logger;
3.(optional)switch errorHandler automation
logger; // stoplogger; // restart
License
Log4browser is under the MIT License.