@crawlee/types 4.0.0-beta.40 → 4.0.0-beta.42

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/index.d.ts CHANGED
@@ -3,4 +3,5 @@ export * from './utility-types.js';
3
3
  export * from './browser.js';
4
4
  export * from './http-client.js';
5
5
  export * from './session.js';
6
+ export * from './logger.js';
6
7
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
package/index.js CHANGED
@@ -3,4 +3,5 @@ export * from './utility-types.js';
3
3
  export * from './browser.js';
4
4
  export * from './http-client.js';
5
5
  export * from './session.js';
6
+ export * from './logger.js';
6
7
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
package/logger.d.ts ADDED
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Configuration options for Crawlee logger implementations.
3
+ */
4
+ export interface CrawleeLoggerOptions {
5
+ /** Prefix to be prepended to each logged line. */
6
+ prefix?: string | null;
7
+ }
8
+ /**
9
+ * Interface for Crawlee logger implementations.
10
+ * This allows users to inject custom loggers (e.g., Winston, Pino) while maintaining
11
+ * compatibility with the default `@apify/log` implementation.
12
+ */
13
+ export interface CrawleeLogger {
14
+ /**
15
+ * Returns the logger configuration.
16
+ */
17
+ getOptions(): CrawleeLoggerOptions;
18
+ /**
19
+ * Configures logger options.
20
+ */
21
+ setOptions(options: Partial<CrawleeLoggerOptions>): void;
22
+ /**
23
+ * Creates a new instance of logger that inherits settings from a parent logger.
24
+ */
25
+ child(options: Partial<CrawleeLoggerOptions>): CrawleeLogger;
26
+ /**
27
+ * Logs an `ERROR` message.
28
+ */
29
+ error(message: string, data?: Record<string, unknown>): void;
30
+ /**
31
+ * Logs an `ERROR` level message with a nicely formatted exception.
32
+ */
33
+ exception(exception: Error, message: string, data?: Record<string, unknown>): void;
34
+ /**
35
+ * Logs a `SOFT_FAIL` level message.
36
+ */
37
+ softFail(message: string, data?: Record<string, unknown>): void;
38
+ /**
39
+ * Logs a `WARNING` level message.
40
+ */
41
+ warning(message: string, data?: Record<string, unknown>): void;
42
+ /**
43
+ * Logs a `WARNING` level message only once.
44
+ */
45
+ warningOnce(message: string): void;
46
+ /**
47
+ * Logs an `INFO` message.
48
+ */
49
+ info(message: string, data?: Record<string, unknown>): void;
50
+ /**
51
+ * Logs a `DEBUG` message.
52
+ */
53
+ debug(message: string, data?: Record<string, unknown>): void;
54
+ /**
55
+ * Logs a `PERF` level message for performance tracking.
56
+ */
57
+ perf(message: string, data?: Record<string, unknown>): void;
58
+ /**
59
+ * Logs given message only once as WARNING for deprecated features.
60
+ */
61
+ deprecated(message: string): void;
62
+ /**
63
+ * Logs a message at the given level. Useful when the log level is determined dynamically.
64
+ */
65
+ logWithLevel(level: number, message: string, data?: Record<string, unknown>): void;
66
+ }
67
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,UAAU,IAAI,oBAAoB,CAAC;IAEnC;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,IAAI,CAAC;IAEzD;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,aAAa,CAAC;IAE7D;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE7D;;OAEG;IACH,SAAS,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAEnF;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAEhE;;OAEG;IACH,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE/D;;OAEG;IACH,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE5D;;OAEG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE7D;;OAEG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAE5D;;OAEG;IACH,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAElC;;OAEG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACtF"}
package/logger.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=logger.js.map
package/logger.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crawlee/types",
3
- "version": "4.0.0-beta.40",
3
+ "version": "4.0.0-beta.42",
4
4
  "description": "Shared types for the crawlee projects",
5
5
  "engines": {
6
6
  "node": ">=22.0.0"
@@ -53,5 +53,5 @@
53
53
  }
54
54
  }
55
55
  },
56
- "gitHead": "679534db27d04c0acf4737700bb979c040845762"
56
+ "gitHead": "fe1827977c6ca78c509f2a7e1106c48b20c1cbf2"
57
57
  }