1.1.1 • Published 8 years ago

ts-debugger v1.1.1

Weekly downloads
18
License
ISC
Repository
github
Last release
8 years ago

Usage

$ npm install ts-debugger --save-dev

Logger information:

// example.ts
import {Logger, Level} from "ts-debugger";
declare let log: Logger;

// show string, array, object
let test = {a: 1, b: 2, c: 3};
log.debug("This is object: ", test);

/*
[DEBUG] [
    "This is object: ",
    {
        "a": 1,
        "b": 2,
        "c": 3
    }
]
*/

log.debug("This is object: ")(test);

/* [DEBUG] This is object:  Object {a: 1, b: 2, c: 3} */

Warning, Error

Example

// polyfills.ts

import {Logger, Level} from "ts-debugger";
import "core-js/client/shim";
import "reflect-metadata";
import "ts-helpers";
require("zone.js/dist/zone");

declare let log: Logger;
declare let window: any;

if (process.env.TYPE === "prod") {
    // Production
    window.log = new Logger(Level.INFO);
} else {
    // Development
    window.log = new Logger();
    Error["stackTraceLimit"] = Infinity;
    require("zone.js/dist/long-stack-trace-zone");
}

log.debug(
    `Level debug: ${log["levelMin"]}`,
    `TYPE = ${process.env.TYPE}`,
    `THEME = ${process.env.THEME}`
)();
1.1.1

8 years ago

1.1.0

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.0-a

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.1

8 years ago