@serenityjs/logger 0.0.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.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # Logger
2
+
@@ -0,0 +1,99 @@
1
+ import * as colorette from 'colorette';
2
+ import { Color, Colorette } from 'colorette';
3
+
4
+ /**
5
+ * A colorized logger for applications.
6
+ */
7
+ declare class Logger {
8
+ /**
9
+ * Whether or not debug messages should be shown.
10
+ */
11
+ static DEBUG: boolean;
12
+ /**
13
+ * The module name of the logger.
14
+ */
15
+ readonly name: string;
16
+ /**
17
+ * The color of module name.
18
+ */
19
+ readonly color: Color;
20
+ /**
21
+ * The colorette instance.
22
+ */
23
+ readonly colorette: Colorette;
24
+ /**
25
+ * Constructs a new logger.
26
+ *
27
+ * @param name - The module name.
28
+ * @param color - The color of the module name.
29
+ */
30
+ constructor(name: string, color: Color);
31
+ /**
32
+ * Logs a message to the console.
33
+ *
34
+ * @param arguments_ - The arguments to log.
35
+ */
36
+ log(...arguments_: Array<unknown>): void;
37
+ /**
38
+ * Logs an info message to the console.
39
+ *
40
+ * @param arguments_ - The arguments to log.
41
+ */
42
+ info(...arguments_: Array<unknown>): void;
43
+ /**
44
+ * Logs a warning message to the console.
45
+ *
46
+ * @param arguments_ - The arguments to log.
47
+ */
48
+ warn(...arguments_: Array<unknown>): void;
49
+ /**
50
+ * Logs an error message to the console.
51
+ *
52
+ * @param arguments_ - The arguments to log.
53
+ */
54
+ error(...arguments_: Array<unknown>): void;
55
+ /**
56
+ * Logs a success message to the console.
57
+ *
58
+ * @param arguments_ - The arguments to log.
59
+ */
60
+ success(...arguments_: Array<unknown>): void;
61
+ /**
62
+ * Logs a debug message to the console.
63
+ * This will only log if the `DEBUG` flag is set to `true`.
64
+ *
65
+ * @param arguments_ - The arguments to log.
66
+ */
67
+ debug(...arguments_: Array<unknown>): void;
68
+ /**
69
+ * Logs a chat message to the console.
70
+ * This shoud not be handeled by anyone just the TextPacket
71
+ * @param arguments_ - The arguments to log.
72
+ */
73
+ chat(...arguments_: Array<unknown>): void;
74
+ }
75
+
76
+ /**
77
+ * Default logger colors.
78
+ */
79
+ declare const LoggerColors: {
80
+ Black: colorette.Color;
81
+ BlackBright: colorette.Color;
82
+ Red: colorette.Color;
83
+ RedBright: colorette.Color;
84
+ Green: colorette.Color;
85
+ GreenBright: colorette.Color;
86
+ Yellow: colorette.Color;
87
+ YellowBright: colorette.Color;
88
+ Blue: colorette.Color;
89
+ BlueBright: colorette.Color;
90
+ Magenta: colorette.Color;
91
+ MagentaBright: colorette.Color;
92
+ Cyan: colorette.Color;
93
+ CyanBright: colorette.Color;
94
+ White: colorette.Color;
95
+ WhiteBright: colorette.Color;
96
+ Gray: colorette.Color;
97
+ };
98
+
99
+ export { Logger, LoggerColors };