sdk-logs 0.6.13 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/domain.objects/LogOutlet.d.ts +33 -0
  2. package/dist/domain.objects/LogOutlet.js +3 -0
  3. package/dist/domain.objects/LogOutlet.js.map +1 -0
  4. package/dist/domain.objects/LogTrail.d.ts +20 -4
  5. package/dist/domain.operations/asCurrentIsoTimestamp.d.ts +5 -0
  6. package/dist/domain.operations/asCurrentIsoTimestamp.js +12 -0
  7. package/dist/domain.operations/asCurrentIsoTimestamp.js.map +1 -0
  8. package/dist/domain.operations/formatLogContentsForEnvironment.d.ts +20 -1
  9. package/dist/domain.operations/formatLogContentsForEnvironment.js +22 -6
  10. package/dist/domain.operations/formatLogContentsForEnvironment.js.map +1 -1
  11. package/dist/domain.operations/genContextLogTrail.d.ts +28 -0
  12. package/dist/domain.operations/genContextLogTrail.js +58 -0
  13. package/dist/domain.operations/genContextLogTrail.js.map +1 -0
  14. package/dist/domain.operations/{generateLogMethods.d.ts → genLogMethods.d.ts} +13 -2
  15. package/dist/domain.operations/genLogMethods.js +42 -0
  16. package/dist/domain.operations/genLogMethods.js.map +1 -0
  17. package/dist/domain.operations/generateLogMethod.d.ts +8 -1
  18. package/dist/domain.operations/generateLogMethod.js +32 -14
  19. package/dist/domain.operations/generateLogMethod.js.map +1 -1
  20. package/dist/domain.operations/outlets/cloudwatch/asCloudWatchBatches.d.ts +8 -0
  21. package/dist/domain.operations/outlets/cloudwatch/asCloudWatchBatches.js +47 -0
  22. package/dist/domain.operations/outlets/cloudwatch/asCloudWatchBatches.js.map +1 -0
  23. package/dist/domain.operations/outlets/cloudwatch/asCloudWatchLogEvents.d.ts +9 -0
  24. package/dist/domain.operations/outlets/cloudwatch/asCloudWatchLogEvents.js +15 -0
  25. package/dist/domain.operations/outlets/cloudwatch/asCloudWatchLogEvents.js.map +1 -0
  26. package/dist/domain.operations/outlets/cloudwatch/asDefaultLogStreamName.d.ts +6 -0
  27. package/dist/domain.operations/outlets/cloudwatch/asDefaultLogStreamName.js +24 -0
  28. package/dist/domain.operations/outlets/cloudwatch/asDefaultLogStreamName.js.map +1 -0
  29. package/dist/domain.operations/outlets/cloudwatch/asLambdaStyleLogGroupName.d.ts +18 -0
  30. package/dist/domain.operations/outlets/cloudwatch/asLambdaStyleLogGroupName.js +57 -0
  31. package/dist/domain.operations/outlets/cloudwatch/asLambdaStyleLogGroupName.js.map +1 -0
  32. package/dist/domain.operations/outlets/cloudwatch/assertAwsCredentialsPresent.d.ts +8 -0
  33. package/dist/domain.operations/outlets/cloudwatch/assertAwsCredentialsPresent.js +46 -0
  34. package/dist/domain.operations/outlets/cloudwatch/assertAwsCredentialsPresent.js.map +1 -0
  35. package/dist/domain.operations/outlets/cloudwatch/computeLogEventSize.d.ts +8 -0
  36. package/dist/domain.operations/outlets/cloudwatch/computeLogEventSize.js +15 -0
  37. package/dist/domain.operations/outlets/cloudwatch/computeLogEventSize.js.map +1 -0
  38. package/dist/domain.operations/outlets/cloudwatch/drainBuffer.d.ts +6 -0
  39. package/dist/domain.operations/outlets/cloudwatch/drainBuffer.js +12 -0
  40. package/dist/domain.operations/outlets/cloudwatch/drainBuffer.js.map +1 -0
  41. package/dist/domain.operations/outlets/cloudwatch/genCloudwatchOutlet.d.ts +24 -0
  42. package/dist/domain.operations/outlets/cloudwatch/genCloudwatchOutlet.js +205 -0
  43. package/dist/domain.operations/outlets/cloudwatch/genCloudwatchOutlet.js.map +1 -0
  44. package/dist/domain.operations/withLogTrail.d.ts +1 -1
  45. package/dist/domain.operations/withLogTrail.js +58 -26
  46. package/dist/domain.operations/withLogTrail.js.map +1 -1
  47. package/dist/index.d.ts +7 -2
  48. package/dist/index.js +11 -3
  49. package/dist/index.js.map +1 -1
  50. package/package.json +5 -4
  51. package/dist/domain.operations/generateLogMethods.js +0 -22
  52. package/dist/domain.operations/generateLogMethods.js.map +0 -1
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "sdk-logs",
3
3
  "author": "ehmpathy",
4
4
  "description": "a simple and opinionated logging library. plays well with aws lambda + cloudwatch.",
5
- "version": "0.6.13",
5
+ "version": "0.8.0",
6
6
  "repository": "ehmpathy/sdk-logs",
7
7
  "homepage": "https://github.com/ehmpathy/sdk-logs",
8
8
  "keywords": [
@@ -57,6 +57,7 @@
57
57
  "prepare": "if [ -e .git ] && [ -z $CI ]; then npm run prepare:husky && npm run prepare:rhachet; fi"
58
58
  },
59
59
  "dependencies": {
60
+ "@aws-sdk/client-cloudwatch-logs": "3.1040.0",
60
61
  "@ehmpathy/error-fns": "^1.3.7",
61
62
  "domain-glossary-procedure": "^1.0.0",
62
63
  "domain-objects": "0.31.10",
@@ -83,12 +84,12 @@
83
84
  "esbuild-register": "3.6.0",
84
85
  "husky": "8.0.3",
85
86
  "jest": "30.2.0",
86
- "rhachet": "1.41.4",
87
+ "rhachet": "1.41.7",
87
88
  "rhachet-brains-anthropic": "^0.4.1",
88
89
  "rhachet-brains-xai": "^0.3.3",
89
90
  "rhachet-roles-bhrain": "0.27.6",
90
- "rhachet-roles-bhuild": "0.21.4",
91
- "rhachet-roles-ehmpathy": "1.35.0",
91
+ "rhachet-roles-bhuild": "0.21.7",
92
+ "rhachet-roles-ehmpathy": "1.35.5",
92
93
  "rhachet-roles-rhachet": "^0.1.7",
93
94
  "test-fns": "1.4.2",
94
95
  "tsc-alias": "1.8.10",
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateLogMethods = void 0;
4
- const constants_1 = require("../domain.objects/constants");
5
- const generateLogMethod_1 = require("./generateLogMethod");
6
- const getRecommendedMinimalLogLevelForEnvironment_1 = require("./getRecommendedMinimalLogLevelForEnvironment");
7
- /**
8
- * define how to generate the log methods
9
- * - allows you to specify the minimal log level to use for your application
10
- * - defaults to recommended levels for the environment
11
- */
12
- const generateLogMethods = ({ minimalLogLevel = (0, getRecommendedMinimalLogLevelForEnvironment_1.getRecommendedMinimalLogLevelForEnvironment)(), } = {}) => {
13
- // generate the methods
14
- return {
15
- error: (0, generateLogMethod_1.generateLogMethod)({ level: constants_1.LogLevel.ERROR, minimalLogLevel }),
16
- warn: (0, generateLogMethod_1.generateLogMethod)({ level: constants_1.LogLevel.WARN, minimalLogLevel }),
17
- info: (0, generateLogMethod_1.generateLogMethod)({ level: constants_1.LogLevel.INFO, minimalLogLevel }),
18
- debug: (0, generateLogMethod_1.generateLogMethod)({ level: constants_1.LogLevel.DEBUG, minimalLogLevel }),
19
- };
20
- };
21
- exports.generateLogMethods = generateLogMethods;
22
- //# sourceMappingURL=generateLogMethods.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generateLogMethods.js","sourceRoot":"","sources":["../../src/domain.operations/generateLogMethods.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AAEzD,2DAAwE;AACxE,+GAA4G;AAgC5G;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,EACjC,eAAe,GAAG,IAAA,yFAA2C,GAAE,MAG7D,EAAE,EAAc,EAAE;IACpB,uBAAuB;IACvB,OAAO;QACL,KAAK,EAAE,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC;QACpE,IAAI,EAAE,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC;QAClE,IAAI,EAAE,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC;QAClE,KAAK,EAAE,IAAA,qCAAiB,EAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,CAAC;KACrE,CAAC;AACJ,CAAC,CAAC;AAZW,QAAA,kBAAkB,sBAY7B"}