@epigraph/epigraph-std-lib 2.0.1 → 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
|
@@ -31629,11 +31629,14 @@ class jR {
|
|
|
31629
31629
|
"error"
|
|
31630
31630
|
/* Error */
|
|
31631
31631
|
] },
|
|
31632
|
-
staging: {
|
|
31633
|
-
"
|
|
31634
|
-
|
|
31635
|
-
|
|
31636
|
-
|
|
31632
|
+
staging: {
|
|
31633
|
+
name: "staging",
|
|
31634
|
+
allows: [
|
|
31635
|
+
"warn",
|
|
31636
|
+
"error"
|
|
31637
|
+
/* Error */
|
|
31638
|
+
]
|
|
31639
|
+
},
|
|
31637
31640
|
dev: {
|
|
31638
31641
|
name: "dev",
|
|
31639
31642
|
allows: [
|
|
@@ -31675,7 +31678,7 @@ class jR {
|
|
|
31675
31678
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
31676
31679
|
* that was provided at the time of initialisation of this class.
|
|
31677
31680
|
*/
|
|
31678
|
-
info(
|
|
31681
|
+
info({ title: e, details: t = "", contextOverride: n = void 0 }) {
|
|
31679
31682
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
31680
31683
|
"info"
|
|
31681
31684
|
/* Info */
|
|
@@ -31695,7 +31698,7 @@ class jR {
|
|
|
31695
31698
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
31696
31699
|
* that was provided at the time of initialisation of this class.
|
|
31697
31700
|
*/
|
|
31698
|
-
warn(
|
|
31701
|
+
warn({ title: e, details: t = "", contextOverride: n = void 0 }) {
|
|
31699
31702
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
31700
31703
|
"warn"
|
|
31701
31704
|
/* Warn */
|
|
@@ -31714,7 +31717,7 @@ class jR {
|
|
|
31714
31717
|
* paramater to make it easy to debug. If not provided, the default context would be used
|
|
31715
31718
|
* that was provided at the time of initialisation of this class.
|
|
31716
31719
|
*/
|
|
31717
|
-
error(
|
|
31720
|
+
error({ title: e, details: t = "", contextOverride: n = void 0 }) {
|
|
31718
31721
|
if (!this._isLogTypeAllowedInCurrentMode(
|
|
31719
31722
|
"error"
|
|
31720
31723
|
/* Error */
|
|
@@ -31736,7 +31739,13 @@ class jR {
|
|
|
31736
31739
|
* that was provided at the time of initialisation of this class.
|
|
31737
31740
|
* @param {LogTypes} logType A
|
|
31738
31741
|
*/
|
|
31739
|
-
table(
|
|
31742
|
+
table({
|
|
31743
|
+
title: e,
|
|
31744
|
+
details: t = {},
|
|
31745
|
+
contextOverride: n = void 0,
|
|
31746
|
+
logType: i = "info"
|
|
31747
|
+
/* Info */
|
|
31748
|
+
}) {
|
|
31740
31749
|
if (!this._isLogTypeAllowedInCurrentMode(i))
|
|
31741
31750
|
return;
|
|
31742
31751
|
const s = n || this.context;
|
|
@@ -31755,7 +31764,12 @@ class jR {
|
|
|
31755
31764
|
* info but this parameter allows the user to override this.
|
|
31756
31765
|
* @returns {void}
|
|
31757
31766
|
*/
|
|
31758
|
-
group(
|
|
31767
|
+
group({
|
|
31768
|
+
title: e,
|
|
31769
|
+
contextOverride: t = void 0,
|
|
31770
|
+
logType: n = "info"
|
|
31771
|
+
/* Info */
|
|
31772
|
+
}) {
|
|
31759
31773
|
if (!this._isLogTypeAllowedInCurrentMode(n))
|
|
31760
31774
|
return;
|
|
31761
31775
|
const i = t || this.context;
|
|
@@ -31774,7 +31788,12 @@ class jR {
|
|
|
31774
31788
|
* info but this parameter allows the user to override this.
|
|
31775
31789
|
* @returns {void}
|
|
31776
31790
|
*/
|
|
31777
|
-
groupCollapsed(
|
|
31791
|
+
groupCollapsed({
|
|
31792
|
+
title: e,
|
|
31793
|
+
contextOverride: t = void 0,
|
|
31794
|
+
logType: n = "info"
|
|
31795
|
+
/* Info */
|
|
31796
|
+
}) {
|
|
31778
31797
|
if (!this._isLogTypeAllowedInCurrentMode(n))
|
|
31779
31798
|
return;
|
|
31780
31799
|
const i = t || this.context;
|