@crawlee/types 4.0.0-beta.165 → 4.0.0-beta.166
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/logger.d.ts +14 -7
- package/package.json +2 -2
package/logger.d.ts
CHANGED
|
@@ -5,6 +5,13 @@ export interface CrawleeLoggerOptions {
|
|
|
5
5
|
/** Prefix to be prepended to each logged line. */
|
|
6
6
|
prefix?: string | null;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Options for a single log call.
|
|
10
|
+
*/
|
|
11
|
+
export interface LogOptions {
|
|
12
|
+
/** Log the message only the first time this logger sees that text, ignoring later calls with it. */
|
|
13
|
+
once?: boolean;
|
|
14
|
+
}
|
|
8
15
|
/**
|
|
9
16
|
* Interface for Crawlee logger implementations.
|
|
10
17
|
* This allows users to inject custom loggers (e.g., Winston, Pino) while maintaining
|
|
@@ -26,7 +33,7 @@ export interface CrawleeLogger {
|
|
|
26
33
|
/**
|
|
27
34
|
* Logs an `ERROR` message.
|
|
28
35
|
*/
|
|
29
|
-
error(message: string, data?: Record<string, unknown
|
|
36
|
+
error(message: string, data?: Record<string, unknown>, options?: LogOptions): void;
|
|
30
37
|
/**
|
|
31
38
|
* Logs an `ERROR` level message with a nicely formatted exception.
|
|
32
39
|
*/
|
|
@@ -34,27 +41,27 @@ export interface CrawleeLogger {
|
|
|
34
41
|
/**
|
|
35
42
|
* Logs a `SOFT_FAIL` level message.
|
|
36
43
|
*/
|
|
37
|
-
softFail(message: string, data?: Record<string, unknown
|
|
44
|
+
softFail(message: string, data?: Record<string, unknown>, options?: LogOptions): void;
|
|
38
45
|
/**
|
|
39
46
|
* Logs a `WARNING` level message.
|
|
40
47
|
*/
|
|
41
|
-
warning(message: string, data?: Record<string, unknown
|
|
48
|
+
warning(message: string, data?: Record<string, unknown>, options?: LogOptions): void;
|
|
42
49
|
/**
|
|
43
|
-
* Logs a `WARNING` level message only once.
|
|
50
|
+
* Logs a `WARNING` level message only once. Shorthand for `warning(message, undefined, { once: true })`.
|
|
44
51
|
*/
|
|
45
52
|
warningOnce(message: string): void;
|
|
46
53
|
/**
|
|
47
54
|
* Logs an `INFO` message.
|
|
48
55
|
*/
|
|
49
|
-
info(message: string, data?: Record<string, unknown
|
|
56
|
+
info(message: string, data?: Record<string, unknown>, options?: LogOptions): void;
|
|
50
57
|
/**
|
|
51
58
|
* Logs a `DEBUG` message.
|
|
52
59
|
*/
|
|
53
|
-
debug(message: string, data?: Record<string, unknown
|
|
60
|
+
debug(message: string, data?: Record<string, unknown>, options?: LogOptions): void;
|
|
54
61
|
/**
|
|
55
62
|
* Logs a `PERF` level message for performance tracking.
|
|
56
63
|
*/
|
|
57
|
-
perf(message: string, data?: Record<string, unknown
|
|
64
|
+
perf(message: string, data?: Record<string, unknown>, options?: LogOptions): void;
|
|
58
65
|
/**
|
|
59
66
|
* Logs given message only once as WARNING for deprecated features.
|
|
60
67
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/types",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.166",
|
|
4
4
|
"description": "Shared types for the crawlee projects",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=22.0.0"
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "5d34cf3b9da170f22cf5b346014ba44060dad827"
|
|
56
56
|
}
|