Making package browser compatible
This commit is contained in:
10
src/test.ts
10
src/test.ts
@ -1,6 +1,6 @@
|
||||
import { Logging, LoggingBase } from "./index";
|
||||
import { randomBytes } from "crypto";
|
||||
import * as fs from "fs";
|
||||
import { Logging, LoggingExtended } from "./index";
|
||||
const deleteFolderRecursive = function (path: string) {
|
||||
if (fs.existsSync(path)) {
|
||||
fs.readdirSync(path).forEach(function (file, index) {
|
||||
@ -28,13 +28,13 @@ Logging.log("\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m\x1b[31m TEST \x1b[31m\x1b[
|
||||
let err = new Error()
|
||||
if (typeof err.stack !== "string") console.log("Stacktrace invalid", err.stack)
|
||||
|
||||
let cus = new LoggingBase({ name: "test" });
|
||||
let cus = new LoggingExtended({ name: "test" });
|
||||
cus.log("Hello from custom Logger")
|
||||
|
||||
let cus2 = new LoggingBase("test2");
|
||||
let cus2 = new LoggingExtended("test2");
|
||||
cus2.log("Hello from custom Logger 2")
|
||||
|
||||
let cus22 = new LoggingBase("test2");
|
||||
let cus22 = new LoggingExtended("test2");
|
||||
cus22.log("Hello from custom Logger 22")
|
||||
cus2.log("Hello from custom Logger 2")
|
||||
cus22.log("Hello from custom Logger 22")
|
||||
@ -46,7 +46,7 @@ cus2.log("Hello from custom Logger 2")
|
||||
cus22.log("Hello from custom Logger 22")
|
||||
cus2.log("Hello from custom Logger 2")
|
||||
|
||||
const BenchmarkLogger = new LoggingBase({
|
||||
const BenchmarkLogger = new LoggingExtended({
|
||||
console: false,
|
||||
name: "bench"
|
||||
})
|
||||
|
Reference in New Issue
Block a user