@archon-inc/sdk
Version:
Integrate easily to our government platform using this SDK. More info on https://archon.inc/sdk
18 lines (17 loc) • 629 B
JavaScript
import { Outcome } from "../types/logging.js";
import recordLog from "./recordLog.js";
/**
* Logs a message with a general event type and completed outcome. Prefer more specific logging functions when available.
* @param args The message to log.
* @returns {Promise<void>} A promise that resolves when the log is recorded.
*/
export async function log(...args) {
// use the same logic as console.log to format the message
const message = args.map((arg) => {
return String(arg);
}).join(" ");
return await recordLog(message, {
eventType: "general",
outcome: Outcome.COMPLETED
});
}