@ghentcdh/tools-vue 0.0.2-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/debugger.d.ts +14 -0
- package/index.d.ts +1 -0
- package/index.mjs +33 -0
- package/package.json +17 -0
package/README.md
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
GhentCdh shared vue tooling
|
|
2
|
+
|
|
3
|
+
# logging-frontend
|
|
4
|
+
|
|
5
|
+
This logging will just perform output to the console. Different levels can be enabled through environment variables
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
VITE_VERBOSE_DEBUG=true // By default this is false
|
|
9
|
+
VITE_DEBUG_ENABLE=true // By default this is false
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import {Debugger} from "@ghentcdh/tools/logging/frontend";
|
|
16
|
+
|
|
17
|
+
Debugger.log('my message');
|
|
18
|
+
```
|
package/debugger.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class Debugger {
|
|
2
|
+
private _verboseEnabled;
|
|
3
|
+
private _debugEnabled;
|
|
4
|
+
private static _instance;
|
|
5
|
+
private constructor();
|
|
6
|
+
private static get instance();
|
|
7
|
+
private static get verboseEnabled();
|
|
8
|
+
private static get debugEnabled();
|
|
9
|
+
static debug(...message: any): void;
|
|
10
|
+
static verbose(...message: any): void;
|
|
11
|
+
static table(...message: any): void;
|
|
12
|
+
static log(...message: any): void;
|
|
13
|
+
static error(...message: any): void;
|
|
14
|
+
}
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './debugger';
|
package/index.mjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
class t {
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
3
|
+
constructor() {
|
|
4
|
+
this._verboseEnabled = !1, this._debugEnabled = !1;
|
|
5
|
+
}
|
|
6
|
+
static get instance() {
|
|
7
|
+
return t._instance || (t._instance = new t()), t._instance;
|
|
8
|
+
}
|
|
9
|
+
static get verboseEnabled() {
|
|
10
|
+
return this.instance._verboseEnabled;
|
|
11
|
+
}
|
|
12
|
+
static get debugEnabled() {
|
|
13
|
+
return this.instance._debugEnabled;
|
|
14
|
+
}
|
|
15
|
+
static debug(...e) {
|
|
16
|
+
this.debugEnabled && console.log(e);
|
|
17
|
+
}
|
|
18
|
+
static verbose(...e) {
|
|
19
|
+
this.verboseEnabled && console.debug(e);
|
|
20
|
+
}
|
|
21
|
+
static table(...e) {
|
|
22
|
+
console.table(e);
|
|
23
|
+
}
|
|
24
|
+
static log(...e) {
|
|
25
|
+
console.log(e);
|
|
26
|
+
}
|
|
27
|
+
static error(...e) {
|
|
28
|
+
console.error(e);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
t as Debugger
|
|
33
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ghentcdh/tools-vue",
|
|
3
|
+
"version": "0.0.2-10",
|
|
4
|
+
"main": "./index.js",
|
|
5
|
+
"types": "./index.d.ts",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"import": "./index.mjs",
|
|
9
|
+
"require": "./index.js",
|
|
10
|
+
"types": "./index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/GhentCDH/ghentcdh-monorepo.git"
|
|
16
|
+
}
|
|
17
|
+
}
|