How to use the lambda-log.LambdaLog function in lambda-log

To help you get started, we’ve selected a few lambda-log examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / lambda-log / lambda-log-tests.ts View on Github external
});
logMessage.level;
logMessage.meta;
logMessage.tags;
logMessage.msg;
logMessage.value;
logMessage.log;
logMessage.toJSON(true);

log.info("info", { key: "value" });
log.warn("warn", { key: "value" });
log.error(new Error("This is an error"), { key: "value" });
log.debug("debug", { key: "value" });
log.assert(true, "this will print");

const logInstance = new log.LambdaLog({
    dynamicMeta: (logMessage: log.LogMessage) => {
        return {
            value: logMessage.value
        };
    }
});
logInstance.log("customLevel", "custom", { key: "value" });
logInstance.info("info", { key: "value" });
logInstance.warn("warn", { key: "value" });
logInstance.error(new Error("This is an error"), { key: "value" });
logInstance.debug("debug", { key: "value" });
logInstance.assert(true, "this will print");

lambda-log

Lightweight logging library for any Node 10+ applications

MIT
Latest version published 3 years ago

Package Health Score

50 / 100
Full package analysis