log
The log built-in module is available to use in your EdgeWorkers code bundles to log messages generated during the current request.
To deliver the logging results from the log module you can either:
- Enable enhanced debug headers or;
- Use a DataStream 2.
Logging only occurs once you’ve requested logging information using Enable enhanced debug headers or a DataStream 2 stream. For more information refer to the JavaScript logging section.
log()
Replaces the format string with the contents of the arguments parameter. The event handler log headers records this change. If you disable logging, the format string is not replaced and the event log headers are not changed.
This function adheres to the log behavior defined in the WhatWG Console Standard document.
debug()
Sends a debug level logging message.
Replaces the format string with the contents of the arguments parameter. The event handler log headers records this change. If you disable logging, the format string is not replaced and the event log headers are not changed.
This function adheres to the log behavior defined in the WhatWG Console Standard document.
error()
Sends a error level logging message.
Replaces the format string with the contents of the arguments parameter. The event handler log headers records this change. If you disable logging, the format string is not replaced and the event log headers are not changed.
This function adheres to the log behavior defined in the WhatWG Console Standard document.
info()
Sends a info level logging message.
Replaces the format string with the contents of the arguments parameter. The event handler log headers records this change. If you disable logging, the format string is not replaced and the event log headers are not changed.
This function adheres to the log behavior defined in the WhatWG Console Standard document.
trace()
Sends a trace level logging message.
Replaces the format string with the contents of the arguments parameter. The event handler log headers records this change. If you disable logging, the format string is not replaced and the event log headers are not changed.
This function adheres to the log behavior defined in the WhatWG Console Standard document.
warn()
Sends a warn level logging message.
Replaces the format string with the contents of the arguments parameter. The event handler log headers records this change. If you disable logging, the format string is not replaced and the event log headers are not changed.
This function adheres to the log behavior defined in the WhatWG Console Standard document.