Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
My implementation is generic, by design. (#1859)
After instantiating a new Debug object with config, a simple JSON object payload can be passed to the send() function. If that object's "type" property is allowed by the current log level, then the output tagged with metadata and the complete JSON object is passed as a string to xdmp.log() A payload type value that is not of an accepted type is rejected. A payload type value that requires a higher log level than currently specified is rejected. All rejected payloads return an Error object with message: "Error: Log level "{this.logLevel}" does not have permission to log type: {payload type}" If we want, we can add payload validation, ensuring that the payload type has the proper parameters (ie. error should required a "stack" property in the payload object) — Edits - changing function signature to "log", rather than "send" Debug.log() seems more logical than Debug.send(), so changing function signature.
- Loading branch information