qstd 0.2.11 → 0.2.12

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.
@@ -547,11 +547,18 @@ var hexColor = () => {
547
547
  var log_exports = {};
548
548
  __export(log_exports, {
549
549
  error: () => error,
550
+ header: () => header,
550
551
  info: () => info,
552
+ label: () => label,
551
553
  log: () => log,
554
+ startTimer: () => startTimer,
552
555
  warn: () => warn
553
556
  });
554
557
  var stringify = (value) => JSON.stringify(value, null, 2);
558
+ var startTimer = () => {
559
+ const start = Date.now();
560
+ return () => Date.now() - start;
561
+ };
555
562
  var log = (...values) => {
556
563
  console.log(...values.map(stringify));
557
564
  };
@@ -564,6 +571,27 @@ var warn = (...values) => {
564
571
  var error = (...values) => {
565
572
  console.log("[error]", ...values.map(stringify));
566
573
  };
574
+ var header = (message) => {
575
+ console.log(`========== ${message} ==========`);
576
+ };
577
+ var label = (name) => ({
578
+ /** Logs values with [label] prefix. Output: `[label] "value"` */
579
+ info: (...values) => {
580
+ console.log(`[${name}]`, ...values.map(stringify));
581
+ },
582
+ /** Logs values with [label] [warn] prefix. Output: `[label] [warn] "value"` */
583
+ warn: (...values) => {
584
+ console.log(`[${name}]`, "[warn]", ...values.map(stringify));
585
+ },
586
+ /** Logs values with [label] [error] prefix. Output: `[label] [error] "value"` */
587
+ error: (...values) => {
588
+ console.log(`[${name}]`, "[error]", ...values.map(stringify));
589
+ },
590
+ /** Logs a header message with [label] prefix. Output: `[label] ========== MESSAGE ==========` */
591
+ header: (message) => {
592
+ console.log(`[${name}] ========== ${message} ==========`);
593
+ }
594
+ });
567
595
 
568
596
  // src/client/dom.ts
569
597
  var dom_exports = {};
@@ -545,11 +545,18 @@ var hexColor = () => {
545
545
  var log_exports = {};
546
546
  __export(log_exports, {
547
547
  error: () => error,
548
+ header: () => header,
548
549
  info: () => info,
550
+ label: () => label,
549
551
  log: () => log,
552
+ startTimer: () => startTimer,
550
553
  warn: () => warn
551
554
  });
552
555
  var stringify = (value) => JSON.stringify(value, null, 2);
556
+ var startTimer = () => {
557
+ const start = Date.now();
558
+ return () => Date.now() - start;
559
+ };
553
560
  var log = (...values) => {
554
561
  console.log(...values.map(stringify));
555
562
  };
@@ -562,6 +569,27 @@ var warn = (...values) => {
562
569
  var error = (...values) => {
563
570
  console.log("[error]", ...values.map(stringify));
564
571
  };
572
+ var header = (message) => {
573
+ console.log(`========== ${message} ==========`);
574
+ };
575
+ var label = (name) => ({
576
+ /** Logs values with [label] prefix. Output: `[label] "value"` */
577
+ info: (...values) => {
578
+ console.log(`[${name}]`, ...values.map(stringify));
579
+ },
580
+ /** Logs values with [label] [warn] prefix. Output: `[label] [warn] "value"` */
581
+ warn: (...values) => {
582
+ console.log(`[${name}]`, "[warn]", ...values.map(stringify));
583
+ },
584
+ /** Logs values with [label] [error] prefix. Output: `[label] [error] "value"` */
585
+ error: (...values) => {
586
+ console.log(`[${name}]`, "[error]", ...values.map(stringify));
587
+ },
588
+ /** Logs a header message with [label] prefix. Output: `[label] ========== MESSAGE ==========` */
589
+ header: (message) => {
590
+ console.log(`[${name}] ========== ${message} ==========`);
591
+ }
592
+ });
565
593
 
566
594
  // src/client/dom.ts
567
595
  var dom_exports = {};
@@ -552,11 +552,18 @@ var hexColor = () => {
552
552
  var log_exports = {};
553
553
  __export(log_exports, {
554
554
  error: () => error,
555
+ header: () => header,
555
556
  info: () => info,
557
+ label: () => label,
556
558
  log: () => log,
559
+ startTimer: () => startTimer,
557
560
  warn: () => warn
558
561
  });
559
562
  var stringify = (value) => JSON.stringify(value, null, 2);
563
+ var startTimer = () => {
564
+ const start = Date.now();
565
+ return () => Date.now() - start;
566
+ };
560
567
  var log = (...values) => {
561
568
  console.log(...values.map(stringify));
562
569
  };
@@ -569,6 +576,27 @@ var warn = (...values) => {
569
576
  var error = (...values) => {
570
577
  console.log("[error]", ...values.map(stringify));
571
578
  };
579
+ var header = (message) => {
580
+ console.log(`========== ${message} ==========`);
581
+ };
582
+ var label = (name) => ({
583
+ /** Logs values with [label] prefix. Output: `[label] "value"` */
584
+ info: (...values) => {
585
+ console.log(`[${name}]`, ...values.map(stringify));
586
+ },
587
+ /** Logs values with [label] [warn] prefix. Output: `[label] [warn] "value"` */
588
+ warn: (...values) => {
589
+ console.log(`[${name}]`, "[warn]", ...values.map(stringify));
590
+ },
591
+ /** Logs values with [label] [error] prefix. Output: `[label] [error] "value"` */
592
+ error: (...values) => {
593
+ console.log(`[${name}]`, "[error]", ...values.map(stringify));
594
+ },
595
+ /** Logs a header message with [label] prefix. Output: `[label] ========== MESSAGE ==========` */
596
+ header: (message) => {
597
+ console.log(`[${name}] ========== ${message} ==========`);
598
+ }
599
+ });
572
600
 
573
601
  // src/server/file.ts
574
602
  var file_exports = {};
@@ -546,11 +546,18 @@ var hexColor = () => {
546
546
  var log_exports = {};
547
547
  __export(log_exports, {
548
548
  error: () => error,
549
+ header: () => header,
549
550
  info: () => info,
551
+ label: () => label,
550
552
  log: () => log,
553
+ startTimer: () => startTimer,
551
554
  warn: () => warn
552
555
  });
553
556
  var stringify = (value) => JSON.stringify(value, null, 2);
557
+ var startTimer = () => {
558
+ const start = Date.now();
559
+ return () => Date.now() - start;
560
+ };
554
561
  var log = (...values) => {
555
562
  console.log(...values.map(stringify));
556
563
  };
@@ -563,6 +570,27 @@ var warn = (...values) => {
563
570
  var error = (...values) => {
564
571
  console.log("[error]", ...values.map(stringify));
565
572
  };
573
+ var header = (message) => {
574
+ console.log(`========== ${message} ==========`);
575
+ };
576
+ var label = (name) => ({
577
+ /** Logs values with [label] prefix. Output: `[label] "value"` */
578
+ info: (...values) => {
579
+ console.log(`[${name}]`, ...values.map(stringify));
580
+ },
581
+ /** Logs values with [label] [warn] prefix. Output: `[label] [warn] "value"` */
582
+ warn: (...values) => {
583
+ console.log(`[${name}]`, "[warn]", ...values.map(stringify));
584
+ },
585
+ /** Logs values with [label] [error] prefix. Output: `[label] [error] "value"` */
586
+ error: (...values) => {
587
+ console.log(`[${name}]`, "[error]", ...values.map(stringify));
588
+ },
589
+ /** Logs a header message with [label] prefix. Output: `[label] ========== MESSAGE ==========` */
590
+ header: (message) => {
591
+ console.log(`[${name}] ========== ${message} ==========`);
592
+ }
593
+ });
566
594
 
567
595
  // src/server/file.ts
568
596
  var file_exports = {};
@@ -1,5 +1,98 @@
1
+ /**
2
+ * Usage Examples:
3
+ *
4
+ * ```typescript // Basic logging
5
+ * Log.info("stuff"); // [info] "stuff"
6
+ * Log.warn("uh oh"); // [warn] "uh oh"
7
+ * Log.error("bad"); // [error] "bad"
8
+ *
9
+ * // Standalone header
10
+ * Log.header("STARTING"); // ========== STARTING ==========
11
+ *
12
+ * // Scoped logger
13
+ * const log = Log.label("audio-processor");
14
+ * log.info("something"); // [audio-processor] "something"
15
+ * log.warn("hmm"); // [audio-processor] [warn] "hmm"
16
+ * log.error("failed"); // [audio-processor] [error] "failed"
17
+ * log.header("HANDLER START"); // [audio-processor] ========== HANDLER START ==========
18
+ *
19
+ */
20
+ /**
21
+ * Starts a timer and returns a function that returns elapsed milliseconds.
22
+ * @returns A function that returns the elapsed time in ms since the timer started
23
+ * @example
24
+ * ```typescript // Timer
25
+ * const elapsed = Log.startTimer();
26
+ * // ... do work ...
27
+ * log.header(`COMPLETE (${elapsed()}ms)`); // ========== COMPLETE (123ms) ==========```
28
+ */
29
+ export declare const startTimer: () => () => number;
30
+ /**
31
+ * Logs values to the console (no prefix).
32
+ * @param values - Values to log (will be JSON stringified)
33
+ * @example
34
+ * ```typescript
35
+ * log("hello"); // "hello"
36
+ * ```
37
+ */
1
38
  export declare const log: (...values: unknown[]) => void;
39
+ /**
40
+ * Logs values with [info] prefix.
41
+ * @param values - Values to log (will be JSON stringified)
42
+ * @example
43
+ * ```typescript
44
+ * info("stuff"); // [info] "stuff"
45
+ * ```
46
+ */
2
47
  export declare const info: (...values: unknown[]) => void;
48
+ /**
49
+ * Logs values with [warn] prefix.
50
+ * @param values - Values to log (will be JSON stringified)
51
+ * @example
52
+ * ```typescript
53
+ * warn("uh oh"); // [warn] "uh oh"
54
+ * ```
55
+ */
3
56
  export declare const warn: (...values: unknown[]) => void;
57
+ /**
58
+ * Logs values with [error] prefix.
59
+ * @param values - Values to log (will be JSON stringified)
60
+ * @example
61
+ * ```typescript
62
+ * error("bad"); // [error] "bad"
63
+ * ```
64
+ */
4
65
  export declare const error: (...values: unknown[]) => void;
66
+ /**
67
+ * Logs a message wrapped in header decoration.
68
+ * @param message - The header message
69
+ * @example
70
+ * ```typescript
71
+ * header("STARTING"); // ========== STARTING ==========
72
+ * ```
73
+ */
74
+ export declare const header: (message: string) => void;
75
+ /**
76
+ * Creates a scoped logger with a label prefix.
77
+ * @param name - The label to prefix all log messages with
78
+ * @returns A logger object with info, warn, error, and header methods
79
+ * @example
80
+ * ```typescript
81
+ * const log = label("audio-processor");
82
+ * log.info("something"); // [audio-processor] "something"
83
+ * log.warn("hmm"); // [audio-processor] [warn] "hmm"
84
+ * log.error("failed"); // [audio-processor] [error] "failed"
85
+ * log.header("HANDLER START"); // [audio-processor] ========== HANDLER START ==========
86
+ * ```
87
+ */
88
+ export declare const label: (name: string) => {
89
+ /** Logs values with [label] prefix. Output: `[label] "value"` */
90
+ info: (...values: unknown[]) => void;
91
+ /** Logs values with [label] [warn] prefix. Output: `[label] [warn] "value"` */
92
+ warn: (...values: unknown[]) => void;
93
+ /** Logs values with [label] [error] prefix. Output: `[label] [error] "value"` */
94
+ error: (...values: unknown[]) => void;
95
+ /** Logs a header message with [label] prefix. Output: `[label] ========== MESSAGE ==========` */
96
+ header: (message: string) => void;
97
+ };
5
98
  //# sourceMappingURL=log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/shared/log.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,GAAI,GAAG,QAAQ,OAAO,EAAE,SAEvC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,GAAG,QAAQ,OAAO,EAAE,SAExC,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,GAAG,QAAQ,OAAO,EAAE,SAExC,CAAC;AAEF,eAAO,MAAM,KAAK,GAAI,GAAG,QAAQ,OAAO,EAAE,SAEzC,CAAC"}
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/shared/log.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU,oBAGtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,GAAG,GAAI,GAAG,QAAQ,OAAO,EAAE,SAEvC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,QAAQ,OAAO,EAAE,SAExC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,QAAQ,OAAO,EAAE,SAExC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,QAAQ,OAAO,EAAE,SAEzC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GAAI,SAAS,MAAM,SAErC,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,GAAI,MAAM,MAAM;IAChC,iEAAiE;sBAC/C,OAAO,EAAE;IAG3B,+EAA+E;sBAC7D,OAAO,EAAE;IAG3B,iFAAiF;uBAC9D,OAAO,EAAE;IAG5B,iGAAiG;sBAC/E,MAAM;CAGxB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qstd",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Standard Block component and utilities library with Panda CSS",
5
5
  "author": "malin1",
6
6
  "license": "MIT",