@epigraph/epigraph-std-lib 2.0.0 → 2.1.0
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.
|
@@ -17,6 +17,32 @@ export declare enum LogTypes {
|
|
|
17
17
|
Warn = "warn",
|
|
18
18
|
Error = "error"
|
|
19
19
|
}
|
|
20
|
+
export interface ILoggerInfo {
|
|
21
|
+
title: string;
|
|
22
|
+
details?: any;
|
|
23
|
+
contextOverride?: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
export interface ILoggerWarning {
|
|
26
|
+
title: string;
|
|
27
|
+
details?: any;
|
|
28
|
+
contextOverride?: string | undefined;
|
|
29
|
+
}
|
|
30
|
+
export interface ILoggerError {
|
|
31
|
+
title: string;
|
|
32
|
+
details?: any;
|
|
33
|
+
contextOverride?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface ILoggerTable {
|
|
36
|
+
title: string;
|
|
37
|
+
details?: any;
|
|
38
|
+
contextOverride?: string | undefined;
|
|
39
|
+
logType?: LogTypes;
|
|
40
|
+
}
|
|
41
|
+
export interface ILoggerGroup {
|
|
42
|
+
title: string;
|
|
43
|
+
contextOverride?: string | undefined;
|
|
44
|
+
logType?: LogTypes;
|
|
45
|
+
}
|
|
20
46
|
/**
|
|
21
47
|
* Epigraph's Logger class that provides various modes and functionalities to easily
|
|
22
48
|
* manage logging within our solutions in a consistent manner.
|
|
@@ -53,7 +79,7 @@ declare class EpigraphLogger {
|
|
|
53
79
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
54
80
|
* that was provided at the time of initialisation of this class.
|
|
55
81
|
*/
|
|
56
|
-
info(title
|
|
82
|
+
info({ title, details, contextOverride }: ILoggerInfo): void;
|
|
57
83
|
/**
|
|
58
84
|
* A warning log type that let's the user know that some action that could be dangerous was just
|
|
59
85
|
* performed and might need attention.
|
|
@@ -65,7 +91,7 @@ declare class EpigraphLogger {
|
|
|
65
91
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
66
92
|
* that was provided at the time of initialisation of this class.
|
|
67
93
|
*/
|
|
68
|
-
warn(title
|
|
94
|
+
warn({ title, details, contextOverride }: ILoggerWarning): void;
|
|
69
95
|
/**
|
|
70
96
|
* A critical error log type that let's the user know that some action that was unexpected and required immediate attention.
|
|
71
97
|
*
|
|
@@ -76,7 +102,7 @@ declare class EpigraphLogger {
|
|
|
76
102
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
77
103
|
* that was provided at the time of initialisation of this class.
|
|
78
104
|
*/
|
|
79
|
-
error(title
|
|
105
|
+
error({ title, details, contextOverride }: ILoggerError): void;
|
|
80
106
|
/**
|
|
81
107
|
* A table log type that can show an object in an organised manner within the console.
|
|
82
108
|
* This is primarily for the visual purposes and doesn't provide any additional functionality
|
|
@@ -90,7 +116,7 @@ declare class EpigraphLogger {
|
|
|
90
116
|
* that was provided at the time of initialisation of this class.
|
|
91
117
|
* @param {LogTypes} logType A
|
|
92
118
|
*/
|
|
93
|
-
table(title
|
|
119
|
+
table({ title, details, contextOverride, logType, }: ILoggerTable): void;
|
|
94
120
|
/**
|
|
95
121
|
* Begins an expanded group with the browser's console window.
|
|
96
122
|
* NOTE: Please remember to close this group once done using EpigraphLogger.groupEnd();
|
|
@@ -104,7 +130,7 @@ declare class EpigraphLogger {
|
|
|
104
130
|
* info but this parameter allows the user to override this.
|
|
105
131
|
* @returns {void}
|
|
106
132
|
*/
|
|
107
|
-
group(title
|
|
133
|
+
group({ title, contextOverride, logType, }: ILoggerGroup): void;
|
|
108
134
|
/**
|
|
109
135
|
* Begins a collapsed group with the browser's console window.
|
|
110
136
|
* NOTE: Please remember to close this group once done using EpigraphLogger.groupEnd();
|
|
@@ -118,7 +144,7 @@ declare class EpigraphLogger {
|
|
|
118
144
|
* info but this parameter allows the user to override this.
|
|
119
145
|
* @returns {void}
|
|
120
146
|
*/
|
|
121
|
-
groupCollapsed(title
|
|
147
|
+
groupCollapsed({ title, contextOverride, logType, }: ILoggerGroup): void;
|
|
122
148
|
/**
|
|
123
149
|
* Similar to the console.groupEnd(). Useful for ending either a group or
|
|
124
150
|
* groupCollapse that was initialised by this logger.
|
package/dist/epigraph-std-lib.js
CHANGED
|
@@ -31625,9 +31625,27 @@ class jR {
|
|
|
31625
31625
|
constructor(e) {
|
|
31626
31626
|
Ca(this, "context", "EPIGRAPH-LOGGER");
|
|
31627
31627
|
Ca(this, "_allModes", {
|
|
31628
|
-
release: { name: "release", allows: [
|
|
31629
|
-
|
|
31630
|
-
|
|
31628
|
+
release: { name: "release", allows: [
|
|
31629
|
+
"error"
|
|
31630
|
+
/* Error */
|
|
31631
|
+
] },
|
|
31632
|
+
staging: {
|
|
31633
|
+
name: "staging",
|
|
31634
|
+
allows: [
|
|
31635
|
+
"warn",
|
|
31636
|
+
"error"
|
|
31637
|
+
/* Error */
|
|
31638
|
+
]
|
|
31639
|
+
},
|
|
31640
|
+
dev: {
|
|
31641
|
+
name: "dev",
|
|
31642
|
+
allows: [
|
|
31643
|
+
"info",
|
|
31644
|
+
"warn",
|
|
31645
|
+
"error"
|
|
31646
|
+
/* Error */
|
|
31647
|
+
]
|
|
31648
|
+
}
|
|
31631
31649
|
});
|
|
31632
31650
|
Ca(this, "_currentMode", "release");
|
|
31633
31651
|
e && (this.context = e.toLocaleUpperCase());
|
|
@@ -31660,7 +31678,7 @@ class jR {
|
|
|
31660
31678
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
31661
31679
|
* that was provided at the time of initialisation of this class.
|
|
31662
31680
|
*/
|
|
31663
|
-
info(
|
|
31681
|
+
info({ title: e, details: t = "", contextOverride: n = void 0 }) {
|
|
31664
31682
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
31665
31683
|
"info"
|
|
31666
31684
|
/* Info */
|
|
@@ -31680,7 +31698,7 @@ class jR {
|
|
|
31680
31698
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
31681
31699
|
* that was provided at the time of initialisation of this class.
|
|
31682
31700
|
*/
|
|
31683
|
-
warn(
|
|
31701
|
+
warn({ title: e, details: t = "", contextOverride: n = void 0 }) {
|
|
31684
31702
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
31685
31703
|
"warn"
|
|
31686
31704
|
/* Warn */
|
|
@@ -31699,7 +31717,7 @@ class jR {
|
|
|
31699
31717
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
31700
31718
|
* that was provided at the time of initialisation of this class.
|
|
31701
31719
|
*/
|
|
31702
|
-
error(
|
|
31720
|
+
error({ title: e, details: t = "", contextOverride: n = void 0 }) {
|
|
31703
31721
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
31704
31722
|
"error"
|
|
31705
31723
|
/* Error */
|
|
@@ -31721,7 +31739,13 @@ class jR {
|
|
|
31721
31739
|
* that was provided at the time of initialisation of this class.
|
|
31722
31740
|
* @param {LogTypes} logType A
|
|
31723
31741
|
*/
|
|
31724
|
-
table(
|
|
31742
|
+
table({
|
|
31743
|
+
title: e,
|
|
31744
|
+
details: t = {},
|
|
31745
|
+
contextOverride: n = void 0,
|
|
31746
|
+
logType: i = "info"
|
|
31747
|
+
/* Info */
|
|
31748
|
+
}) {
|
|
31725
31749
|
if (!this._isLogTypeAllowedInCurrentMode(i))
|
|
31726
31750
|
return;
|
|
31727
31751
|
const s = n || this.context;
|
|
@@ -31740,7 +31764,12 @@ class jR {
|
|
|
31740
31764
|
* info but this parameter allows the user to override this.
|
|
31741
31765
|
* @returns {void}
|
|
31742
31766
|
*/
|
|
31743
|
-
group(
|
|
31767
|
+
group({
|
|
31768
|
+
title: e,
|
|
31769
|
+
contextOverride: t = void 0,
|
|
31770
|
+
logType: n = "info"
|
|
31771
|
+
/* Info */
|
|
31772
|
+
}) {
|
|
31744
31773
|
if (!this._isLogTypeAllowedInCurrentMode(n))
|
|
31745
31774
|
return;
|
|
31746
31775
|
const i = t || this.context;
|
|
@@ -31759,7 +31788,12 @@ class jR {
|
|
|
31759
31788
|
* info but this parameter allows the user to override this.
|
|
31760
31789
|
* @returns {void}
|
|
31761
31790
|
*/
|
|
31762
|
-
groupCollapsed(
|
|
31791
|
+
groupCollapsed({
|
|
31792
|
+
title: e,
|
|
31793
|
+
contextOverride: t = void 0,
|
|
31794
|
+
logType: n = "info"
|
|
31795
|
+
/* Info */
|
|
31796
|
+
}) {
|
|
31763
31797
|
if (!this._isLogTypeAllowedInCurrentMode(n))
|
|
31764
31798
|
return;
|
|
31765
31799
|
const i = t || this.context;
|