aiiinotate 0.10.2 → 0.10.3

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.
@@ -18,7 +18,7 @@ AIIINOTATE_SCHEME=http
18
18
  AIIINOTATE_LOG_TARGET=stdout
19
19
  # directory to save logs to (if AIIINOTATE_LOG_TARGET enables logging to file)
20
20
  AIIINOTATE_LOG_DIR=
21
- # log level. "debug"|"info"|"warning"|"error"
21
+ # log level. "trace"|"debug"|"info"|"warn"|"error"|"fatal"
22
22
  AIIINOTATE_LOG_LEVEL=debug
23
23
 
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiiinotate",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "a fast IIIF-compliant annotation server",
5
5
  "main": "./cli/index.js",
6
6
  "type": "module",
package/src/constants.js CHANGED
@@ -42,6 +42,12 @@ if (Object.values(env_mapper).some(e => e==null)) {
42
42
  process.exit(1);
43
43
  }
44
44
 
45
+ const allowedLogLevels = [ "trace", "debug", "info", "warn", "error", "fatal" ];
46
+ if (!allowedLogLevels.includes(LOG_LEVEL)) {
47
+ console.error(`SETUP ERROR: env variable AIIINOTATE_LOG_TARGET must be set to one of ${allowedLogLevels.map(x => "\"" + x + "\"").join(", ")}. Got "${LOG_LEVEL}". Exiting...`)
48
+ process.exit(1);
49
+ }
50
+
45
51
  // enforce value constraints on variables
46
52
  const allowedLogTargets = [ "file", "stdout", "stdout+file", "off" ];
47
53
  if (!allowedLogTargets.includes(LOG_TARGET)) {