h1v3 0.7.0 → 0.7.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "h1v3",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "author": "",
@@ -17,10 +17,12 @@ export function configureConfigStore(paths, _onValueWritten, _observe) {
17
17
 
18
18
  }
19
19
 
20
+ const googleLogLevels = ["DEBUG", "INFO", "NOTICE", "WARNING", "ERROR", "CRITICAL", "ALERT", "EMERGENCY"];
21
+
20
22
  function decideSeverity(newData) {
21
23
 
22
- const text = newData.severity_text?.toLowerCase();
23
- return ["trace", "fatal", "info", "debug", "error", "warn"].includes(text) ? text : "info";
24
+ const text = newData.severity_text?.toUpperCase();
25
+ return googleLogLevels.includes(text) ? text : "info";
24
26
 
25
27
  }
26
28
 
@@ -81,7 +83,7 @@ export function configureLoggingStore({ paths, onValueWritten, observe, region,
81
83
  write: all(
82
84
  // required
83
85
  assertNewDataHasString("body", 500, 1),
84
- assertNewDataHasOneOf("severity_text", "TRACE", "DEBUG", "INFO", "WARN", "ERROR", "FATAL"),
86
+ assertNewDataHasOneOf("severity_text", ...googleLogLevels),
85
87
  // trace context
86
88
  all(
87
89
  assertNewDataHasLowercaseHexCharacters("trace_id", 32),