Merge pull request #14353 from daberni/jsnlog_serialize

jsnlog: added serialize to JSNLogOptions
This commit is contained in:
Arthur Ozga
2017-02-09 15:56:52 -08:00
committed by GitHub
3 changed files with 12 additions and 4 deletions

7
jsnlog/index.d.ts vendored
View File

@@ -1,4 +1,4 @@
// Type definitions for JSNLog 2.17.3
// Type definitions for JSNLog 2.17
// Project: https://github.com/mperdeck/jsnlog.js
// Definitions by: Mattijs Perdeck <https://github.com/mperdeck>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -8,7 +8,7 @@
// http://jsnlog.com
// -------------------------------
/**
/**
* Copyright 2016 Mattijs Perdeck.
*
* This project is licensed under the MIT license.
@@ -33,6 +33,7 @@ declare namespace JL {
clientIP?: string;
requestId?: string;
defaultBeforeSend?: (xhr: XMLHttpRequest) => void;
serialize?: (obj: any) => string;
}
interface JSNLogFilterOptions {
@@ -87,7 +88,7 @@ declare namespace JL {
declare function __jsnlog_configure(jsnlog: any): void;

// Ambient declaration of the JL function itself
declare function JL(loggerName?: string): JL.JSNLogLogger;

View File

@@ -18,7 +18,8 @@ JL.setOptions({
defaultAjaxUrl: '/jsnlog.logger',
clientIP: '0.0.0.0',
requestId: 'a reuest id',
defaultBeforeSend: null
defaultBeforeSend: null,
serialize: (obj) => JSON.stringify(obj)
});
// ----------------------------------------------------------

6
jsnlog/tslint.json Normal file
View File

@@ -0,0 +1,6 @@
{
"extends": "../tslint.json",
"rules": {
"no-empty-interface": false
}
}