Draft
Conversation
janbuchar
reviewed
Feb 9, 2026
Comment on lines
+56
to
+101
| error(message: string, data?: Record<string, any> | null): void; | ||
|
|
||
| /** | ||
| * Logs an `ERROR` level message with a nicely formatted exception. | ||
| */ | ||
| exception(exception: Error, message: string, data?: Record<string, any> | null): void; | ||
|
|
||
| /** | ||
| * Logs a `SOFT_FAIL` level message. | ||
| */ | ||
| softFail(message: string, data?: Record<string, any> | null): void; | ||
|
|
||
| /** | ||
| * Logs a `WARNING` level message. | ||
| */ | ||
| warning(message: string, data?: Record<string, any> | null): void; | ||
|
|
||
| /** | ||
| * Logs a `WARNING` level message only once. | ||
| */ | ||
| warningOnce(message: string): void; | ||
|
|
||
| /** | ||
| * Logs an `INFO` message. | ||
| */ | ||
| info(message: string, data?: Record<string, any> | null): void; | ||
|
|
||
| /** | ||
| * Logs a `DEBUG` message. | ||
| */ | ||
| debug(message: string, data?: Record<string, any> | null): void; | ||
|
|
||
| /** | ||
| * Logs a `PERF` level message for performance tracking. | ||
| */ | ||
| perf(message: string, data?: Record<string, any> | null): void; | ||
|
|
||
| /** | ||
| * Logs given message only once as WARNING for deprecated features. | ||
| */ | ||
| deprecated(message: string): void; | ||
|
|
||
| /** | ||
| * Internal logging method used by some Crawlee internals. | ||
| */ | ||
| internal(level: number, message: string, data?: any, exception?: any): void; |
Contributor
There was a problem hiding this comment.
It might be more practical to require a single log(message, level, once) method in the interface and provide these helper methods through some wrapper.
Feel free to tweak stuff to a reasonable degree, we can affor BC breaks. We don't really need to keep @apify/log directly assignable to CrawlingContext.log. It's no problem if that's going to require some additional wrapper or even adding a new method to @apify/log.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
idea is to create and export CheerioCrawler which can be implemented by user
example usage (using winston)
index.ts