@effect-aws/powertools-logger
Advanced tools
Comparing version 0.2.1 to 0.3.0
# @effect-aws/powertools-logger | ||
## 0.3.0 | ||
### Minor Changes | ||
- [`d43c957`](https://github.com/floydspace/effect-aws/commit/d43c95706d5798502d1794c3ed92fa301afd4a02) Thanks [@floydspace](https://github.com/floydspace)! - add an ability provide config options through layer, renamed the layer variables | ||
## 0.2.1 | ||
@@ -4,0 +10,0 @@ |
@@ -0,2 +1,3 @@ | ||
export * from "./Context"; | ||
export * from "./Logger"; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxVQUFVLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tIFwiLi9Mb2dnZXJcIjtcbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxVQUFVLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tIFwiLi9Db250ZXh0XCI7XG5leHBvcnQgKiBmcm9tIFwiLi9Mb2dnZXJcIjtcbiJdfQ== |
@@ -1,3 +0,1 @@ | ||
import { Logger } from "@aws-lambda-powertools/logger"; | ||
import * as Context from "@effect/data/Context"; | ||
import * as HashMap from "@effect/data/HashMap"; | ||
@@ -13,3 +11,3 @@ import * as List from "@effect/data/List"; | ||
import * as LogLevel from "@effect/io/LogLevel"; | ||
export const LoggerInstanceTag = Context.Tag("@effect-aws/Powertools/Logger"); | ||
import { DefaultLoggerOptionsLayer, LoggerInstanceLayer, LoggerInstanceTag, } from "./Context"; | ||
const logExtraInput = FiberRef.unsafeMake([]); | ||
@@ -54,3 +52,3 @@ const processLog = (effect) => { | ||
export const logCritical = processLog(Effect.logFatal); | ||
export const powerToolsImpl = (logger) => { | ||
const powerToolsImpl = (logger) => { | ||
return Log.make((options) => { | ||
@@ -78,13 +76,15 @@ const [...extraInputs] = FiberRefs.getOrDefault(options.context, logExtraInput); | ||
}; | ||
export const DefaultLoggerInstanceLayer = Layer.succeed(LoggerInstanceTag, new Logger()); | ||
const PowerToolsLogger = LoggerInstanceTag.pipe(Effect.map(powerToolsImpl)); | ||
const PowerToolsDefaultLogger = PowerToolsLogger.pipe(Effect.provideLayer(DefaultLoggerInstanceLayer)); | ||
const PowerToolsLoggerEffect = LoggerInstanceTag.pipe(Effect.map(powerToolsImpl)); | ||
/** | ||
* Creates a logger layer implementation that uses the default AWS Lambda Powertools Logger instance. | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance provided by implementation layer. | ||
*/ | ||
export const PowerToolsDefaultLoggerLayer = Layer.merge(Log.replaceEffect(Log.defaultLogger, PowerToolsDefaultLogger), Log.minimumLogLevel(LogLevel.All)); | ||
export const BasePowerToolsLoggerLayer = Layer.merge(Log.replaceEffect(Log.defaultLogger, PowerToolsLoggerEffect), Log.minimumLogLevel(LogLevel.All)); | ||
/** | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance provided by implementation layer. | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance configured by logger options layer. | ||
*/ | ||
export const PowerToolsLoggerLayer = Layer.merge(Log.replaceEffect(Log.defaultLogger, PowerToolsLogger), Log.minimumLogLevel(LogLevel.All)); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL0xvZ2dlci50cyJdLCJu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WVyID0gTGF5ZXIubWVyZ2UoXG4gIExvZy5yZXBsYWNlRWZmZWN0KExvZy5kZWZhdWx0TG9nZ2VyLCBQb3dlclRvb2xzRGVmYXVsdExvZ2dlciksXG4gIExvZy5taW5pbXVtTG9nTGV2ZWwoTG9nTGV2ZWwuQWxsKSwgLy8gTG9nIGxldmVsIGlzIGNvbnRyb2xsZWQgYnkgdGhlIFBvd2VyVG9vbHMgTG9nZ2VyIGluc3RhbmNlXG4pO1xuXG4vKipcbiAqIENyZWF0ZXMgYSBsb2dnZXIgbGF5ZXIgaW1wbGVtZW50YXRpb24gdGhhdCB1c2VzIHRoZSBBV1MgTGFtYmRhIFBvd2VydG9vbHMgTG9nZ2VyIGluc3RhbmNlIHByb3ZpZGVkIGJ5IGltcGxlbWVudGF0aW9uIGxheWVyLlxuICovXG5leHBvcnQgY29uc3QgUG93ZXJUb29sc0xvZ2dlckxheWVyID0gTGF5ZXIubWVyZ2UoXG4gIExvZy5yZXBsYWNlRWZmZWN0KExvZy5kZWZhdWx0TG9nZ2VyLCBQb3dlclRvb2xzTG9nZ2VyKSxcbiAgTG9nLm1pbmltdW1Mb2dMZXZlbChMb2dMZXZlbC5BbGwpLFxuKTtcbiJdfQ== | ||
export const PowerToolsLoggerLayer = BasePowerToolsLoggerLayer.pipe(Layer.use(LoggerInstanceLayer)); | ||
/** | ||
* Creates a logger layer implementation that uses the default AWS Lambda Powertools Logger instance. | ||
*/ | ||
export const DefaultPowerToolsLoggerLayer = PowerToolsLoggerLayer.pipe(Layer.use(DefaultLoggerOptionsLayer)); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL0xvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFLQSxPQUFPLEtBQUssT0FBTyxNQUFNLHNCQUFzQixDQUFDO0FBQ2hELE9BQU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2dlckxheWVyLnBpcGUoXG4gIExheWVyLnVzZShEZWZhdWx0TG9nZ2VyT3B0aW9uc0xheWVyKSxcbik7XG4iXX0= |
@@ -0,1 +1,2 @@ | ||
export * from "./Context"; | ||
export * from "./Logger"; |
@@ -17,3 +17,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./Context"), exports); | ||
__exportStar(require("./Logger"), exports); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDJDQUF5QiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gXCIuL0xvZ2dlclwiO1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLDRDQUEwQjtBQUMxQiwyQ0FBeUIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tIFwiLi9Db250ZXh0XCI7XG5leHBvcnQgKiBmcm9tIFwiLi9Mb2dnZXJcIjtcbiJdfQ== |
import { Logger } from "@aws-lambda-powertools/logger"; | ||
import type { LogItemExtraInput, LogItemMessage } from "@aws-lambda-powertools/logger/lib/types"; | ||
import * as Context from "@effect/data/Context"; | ||
import * as Effect from "@effect/io/Effect"; | ||
import * as Layer from "@effect/io/Layer"; | ||
import * as Log from "@effect/io/Logger"; | ||
export declare const LoggerInstanceTag: Context.Tag<Logger, Logger>; | ||
/** | ||
@@ -39,11 +36,13 @@ * Logs the specified message at the debug log level. | ||
export declare const logCritical: (input: LogItemMessage, ...extraInput: LogItemExtraInput) => Effect.Effect<never, never, void>; | ||
export declare const powerToolsImpl: (logger: Logger) => Log.Logger<unknown, void>; | ||
export declare const DefaultLoggerInstanceLayer: Layer.Layer<never, never, Logger>; | ||
/** | ||
* Creates a logger layer implementation that uses the default AWS Lambda Powertools Logger instance. | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance provided by implementation layer. | ||
*/ | ||
export declare const PowerToolsDefaultLoggerLayer: Layer.Layer<never, never, never>; | ||
export declare const BasePowerToolsLoggerLayer: Layer.Layer<Logger, never, never>; | ||
/** | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance provided by implementation layer. | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance configured by logger options layer. | ||
*/ | ||
export declare const PowerToolsLoggerLayer: Layer.Layer<Logger, never, never>; | ||
export declare const PowerToolsLoggerLayer: Layer.Layer<import("./Context").LoggerOptions, never, never>; | ||
/** | ||
* Creates a logger layer implementation that uses the default AWS Lambda Powertools Logger instance. | ||
*/ | ||
export declare const DefaultPowerToolsLoggerLayer: Layer.Layer<never, never, never>; |
@@ -26,5 +26,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.PowerToolsLoggerLayer = exports.PowerToolsDefaultLoggerLayer = exports.DefaultLoggerInstanceLayer = exports.powerToolsImpl = exports.logCritical = exports.logFatal = exports.logError = exports.logWarning = exports.logInfo = exports.logDebug = exports.LoggerInstanceTag = void 0; | ||
const logger_1 = require("@aws-lambda-powertools/logger"); | ||
const Context = __importStar(require("@effect/data/Context")); | ||
exports.DefaultPowerToolsLoggerLayer = exports.PowerToolsLoggerLayer = exports.BasePowerToolsLoggerLayer = exports.logCritical = exports.logFatal = exports.logError = exports.logWarning = exports.logInfo = exports.logDebug = void 0; | ||
const HashMap = __importStar(require("@effect/data/HashMap")); | ||
@@ -40,3 +38,3 @@ const List = __importStar(require("@effect/data/List")); | ||
const LogLevel = __importStar(require("@effect/io/LogLevel")); | ||
exports.LoggerInstanceTag = Context.Tag("@effect-aws/Powertools/Logger"); | ||
const Context_1 = require("./Context"); | ||
const logExtraInput = FiberRef.unsafeMake([]); | ||
@@ -104,14 +102,15 @@ const processLog = (effect) => { | ||
}; | ||
exports.powerToolsImpl = powerToolsImpl; | ||
exports.DefaultLoggerInstanceLayer = Layer.succeed(exports.LoggerInstanceTag, new logger_1.Logger()); | ||
const PowerToolsLogger = exports.LoggerInstanceTag.pipe(Effect.map(exports.powerToolsImpl)); | ||
const PowerToolsDefaultLogger = PowerToolsLogger.pipe(Effect.provideLayer(exports.DefaultLoggerInstanceLayer)); | ||
const PowerToolsLoggerEffect = Context_1.LoggerInstanceTag.pipe(Effect.map(powerToolsImpl)); | ||
/** | ||
* Creates a logger layer implementation that uses the default AWS Lambda Powertools Logger instance. | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance provided by implementation layer. | ||
*/ | ||
exports.PowerToolsDefaultLoggerLayer = Layer.merge(Log.replaceEffect(Log.defaultLogger, PowerToolsDefaultLogger), Log.minimumLogLevel(LogLevel.All)); | ||
exports.BasePowerToolsLoggerLayer = Layer.merge(Log.replaceEffect(Log.defaultLogger, PowerToolsLoggerEffect), Log.minimumLogLevel(LogLevel.All)); | ||
/** | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance provided by implementation layer. | ||
* Creates a logger layer implementation that uses the AWS Lambda Powertools Logger instance configured by logger options layer. | ||
*/ | ||
exports.PowerToolsLoggerLayer = Layer.merge(Log.replaceEffect(Log.defaultLogger, PowerToolsLogger), Log.minimumLogLevel(LogLevel.All)); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0xvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7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mZlY3QoTG9nLmRlZmF1bHRMb2dnZXIsIFBvd2VyVG9vbHNMb2dnZXIpLFxuICBMb2cubWluaW11bUxvZ0xldmVsKExvZ0xldmVsLkFsbCksXG4pO1xuIl19 | ||
exports.PowerToolsLoggerLayer = exports.BasePowerToolsLoggerLayer.pipe(Layer.use(Context_1.LoggerInstanceLayer)); | ||
/** | ||
* Creates a logger layer implementation that uses the default AWS Lambda Powertools Logger instance. | ||
*/ | ||
exports.DefaultPowerToolsLoggerLayer = exports.PowerToolsLoggerLayer.pipe(Layer.use(Context_1.DefaultLoggerOptionsLayer)); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTG9nZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0xvZ2dlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUtBLDhEQUFnRDtBQUNoRCx3REFBMEM7QUFDMUMsd0RBQTBDO0FBQzFDLDBEQUE0QztBQUM1Qyw0REFBOEM7QUFDOUMsOERBQWdEO0FBQ2hELGdFQUFrRDtBQUNsRCx3REFBMEM7QUFDMUMsdURBQXlDO0FBQ3pDLDhEQUFnRDtBQUNoRCx1Q0FJbUI7QUFFbkIsTUFBTSxhQUFhLEdBQUcsUUFBUSxDQUFDLFVBQVUsQ0FBb0IsRUFBRSxDQUFDLENBQUM7QUFFakUsTUFBTSxVQUFVLEdBQUcsQ0FDakIsTUFBOEQsRUFDOUQsRUFBRTtJQUNGLE9BQU8sQ0FBQyxLQUFxQixFQUFFLEdBQUcsVUFBNkIsRUFBRSxFQUFFO1FBQ2pFLE1BQU0sT0FBTyxHQUFHLE9BQU8sS0FBSyxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsT0FBTyxDQUFDO1FBRWxFLE1B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G5leHBvcnQgY29uc3QgRGVmYXVsdFBvd2VyVG9vbHNMb2dnZXJMYXllciA9IFBvd2VyVG9vbHNMb2dnZXJMYXllci5waXBlKFxuICBMYXllci51c2UoRGVmYXVsdExvZ2dlck9wdGlvbnNMYXllciksXG4pO1xuIl19 |
@@ -24,3 +24,3 @@ { | ||
"prettier": "^3.0.3", | ||
"projen": "^0.73.24", | ||
"projen": "^0.73.25", | ||
"ts-jest": "^29.1.1", | ||
@@ -41,3 +41,3 @@ "typescript": "^5.2.2" | ||
}, | ||
"version": "0.2.1", | ||
"version": "0.3.0", | ||
"types": "lib/index.d.ts", | ||
@@ -44,0 +44,0 @@ "module": "lib/esm/index.js", |
@@ -25,3 +25,3 @@ # @effect-aws/powertools-logger | ||
program, | ||
Effect.provideLayer(Logger.PowerToolsDefaultLoggerLayer), | ||
Effect.provideLayer(Logger.DefaultPowerToolsLoggerLayer), | ||
Effect.runPromise, | ||
@@ -31,2 +31,25 @@ ); | ||
With custom PowerTools Logger options: | ||
```typescript | ||
import { pipe } from "@effect/data/Function"; | ||
import * as Effect from "@effect/io/Effect"; | ||
import * as Logger from "@effect-aws/powertools-logger"; | ||
const program = pipe( | ||
Logger.logDebug("Debug message with log meta", { foo: "bar" }), | ||
Effect.tap(() => Effect.logDebug("Native effect debug message")), | ||
); | ||
const result = pipe( | ||
program, | ||
Effect.provideLayer(Logger.PowerToolsLoggerLayer), | ||
Effect.provideService( | ||
Logger.LoggerOptionsTag, | ||
new Logger.LoggerOptions({ logLevel: "DEBUG" }), | ||
), | ||
Effect.runPromise, | ||
); | ||
``` | ||
With custom PowerTools Logger instance: | ||
@@ -47,3 +70,3 @@ | ||
program, | ||
Effect.provideLayer(Logger.PowerToolsLoggerLayer), | ||
Effect.provideLayer(Logger.BasePowerToolsLoggerLayer), | ||
Effect.provideService( | ||
@@ -50,0 +73,0 @@ Logger.LoggerInstanceTag, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49687
17
414
76