2.0.0 • Published 4 years ago

log4browser v2.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

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 JS
var log4browser = require("log4browser");
var logger = new log4browser();
// Or in ES Modules
import log4browser from 'log4browser';
var logger = new log4browser();

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
    errorHandler: function (logData) {
        // something to do with logData
    }
};
logger.init(config);

3.(optional)switch errorHandler automation

logger.setIsAutoHandle(false); // stop
logger.setIsAutoHandle(true); // restart

License

Log4browser is under the MIT License.

1.9.0

4 years ago

2.0.0

4 years ago

1.8.3

4 years ago

1.8.2

4 years ago

1.8.1

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.1.0

4 years ago