Compare commits

..

No commits in common. "b92caf6468a2304ec2a26defca5f820ff9361332" and "1fd8da459bf0644fa2520e1fe6a15815a08ca58f" have entirely different histories.

9 changed files with 240 additions and 255 deletions

2
.gitignore vendored
View File

@ -2,4 +2,4 @@ node_modules/
logs/
yarn.lock
out/
esm/
.history/

410
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,12 @@
{
"name": "@hibas123/logging",
"version": "2.5.4",
"version": "2.4.4",
"description": "",
"main": "out/index.js",
"types": "out/index.d.ts",
"module": "esm/index.js",
"scripts": {
"prepublish": "npm run build",
"build": "tsc && tsc -p tsconfig.esm.json",
"prepublish": "tsc",
"build": "tsc",
"dev": "nodemon -e ts --exec ts-node src/test.ts"
},
"repository": {
@ -19,17 +18,16 @@
"files": [
"src/",
"out/",
"esm/",
"tsconfig.json",
"readme.md"
],
"devDependencies": {
"concurrently": "^5.3.0",
"nodemon": "^2.0.4",
"ts-node": "^9.0.0",
"typescript": "^4.0.2"
"concurrently": "^5.1.0",
"nodemon": "^2.0.3",
"ts-node": "^8.8.2",
"typescript": "^3.8.3"
},
"dependencies": {
"@hibas123/utils": "^2.2.10"
"@hibas123/utils": "^2.2.4"
}
}

View File

@ -1,6 +1,6 @@
import { Observable, ObservableInterface } from "@hibas123/utils";
import { ConsoleAdapter } from "./consolewriter.js";
import inspect from "./inspect.js";
import { ConsoleAdapter } from "./consolewriter";
import inspect from "./inspect";
import {
Adapter,
LoggingTypes,
@ -12,7 +12,7 @@ import {
Colors,
FormattedText,
FormattedLine,
} from "./types.js";
} from "./types";
const browser = typeof window !== "undefined";
@ -194,11 +194,11 @@ export class LoggingBase {
}
}
#closed = false;
private $closed = false;
public close() {
if (this.#closed) return;
this.#closed = true;
if (this.$closed) return;
this.$closed = true;
this.adapterSet.adapters.forEach((adapter) => {
let cached = adapterCache.get(adapter);
@ -319,7 +319,7 @@ export class LoggingBase {
message: any[],
caller?: { file: string; line: number; column?: number }
) {
if (this.#closed) return;
if (this.$closed) return;
let date = new Date().toISOString().replace(/T/, " ").replace(/\..+/, "");

View File

@ -1,16 +1,14 @@
import { ObservableInterface } from "@hibas123/utils";
import { Colors } from "./index.js";
import { Colors } from "./index";
import {
Adapter,
Message,
FormattedLine,
TerminalFormats,
FormatTypes,
} from "./types.js";
} from "./types";
declare const Deno: any;
const browser = typeof window !== "undefined" && typeof Deno === "undefined";
const browser = typeof window !== "undefined";
export class ConsoleAdapter implements Adapter {
constructor(private colors: boolean = true) {}

View File

@ -1,11 +1,11 @@
import { LoggingBase } from "./base.js";
export { ConsoleAdapter } from "./consolewriter.js";
import { LoggingBase } from "./base";
export { ConsoleAdapter } from "./consolewriter";
export {
LoggingBase,
LoggingBaseOptions,
removeColors,
withColor,
} from "./base.js";
} from "./base";
export {
Adapter,
LoggingTypes,
@ -18,7 +18,7 @@ export {
Format,
FormatTypes,
TerminalFormats,
} from "./types.js";
} from "./types";
export { ObservableInterface } from "@hibas123/utils";

View File

@ -1,10 +1,4 @@
import {
Logging,
LoggingBase,
LoggingTypes,
Colors,
withColor,
} from "./index.js";
import { Logging, LoggingBase, LoggingTypes, Colors, withColor } from ".";
Logging.log("test");
Logging.log("i", "am", { a: "an" }, 1000);

View File

@ -1,11 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "ESNext",
"target": "ES2017",
"moduleResolution": "node",
"outDir": "esm"
},
"exclude": ["node_modules"],
"include": ["src"]
}

View File

@ -1,13 +1,19 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "esnext",
"target": "es2017",
"noImplicitAny": false,
"sourceMap": true,
"outDir": "out",
"declaration": true,
"typeRoots": ["node_modules/@types"]
"typeRoots": [
"node_modules/@types"
]
},
"exclude": ["node_modules"],
"include": ["src"]
"exclude": [
"node_modules"
],
"include": [
"src"
]
}