You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -190,7 +190,7 @@ ignored.
190
190
| `--target` | `FUNCTION_TARGET` | The name of the exported function to be invoked in response to requests. Default: `function` |
191
191
| `--signature-type` | `FUNCTION_SIGNATURE_TYPE` | The signature used when writing your function. Controls unmarshalling rules and determines which arguments are used to invoke your function. Default: `http`; accepted values: `http` or `event` or `cloudevent` |
192
192
| `--source` | `FUNCTION_SOURCE` | The path to the directory of your function. Default: `cwd` (the current working directory) |
193
-
| / | `LOG_EXECUTION_ID` | Enables execution IDs in logs, either `true` or `false`. When not specified, default to enable. Requires Node.js 13.0.0 or later. |
193
+
| `--log-execution-id`| `LOG_EXECUTION_ID` | Enables execution IDs in logs, either `true` or `false`. When not specified, default to disable. Requires Node.js 13.0.0 or later. |
194
194
195
195
You can set command-line flags in your `package.json` via the `start` script.
`Execution id is only supported with Node.js versions ${requiredNodeJsVersionForLogExecutionID} and above. Your current version is ${nodeVersion}. Please upgrade.`
117
+
constExecutionIdOption=newConfigurableOption(
118
+
'log-execution-id',
119
+
'LOG_EXECUTION_ID',
120
+
false,
121
+
x=>{
122
+
constnodeVersion=process.versions.node;
123
+
constisVersionSatisfied=semver.gte(
124
+
nodeVersion,
125
+
requiredNodeJsVersionForLogExecutionID
136
126
);
127
+
constisTrue=
128
+
(typeofx==='boolean'&&x)||
129
+
(typeofx==='string'&&x.toLowerCase()==='true');
130
+
if(isTrue&&!isVersionSatisfied){
131
+
thrownewOptionsError(
132
+
`Execution id is only supported with Node.js versions ${requiredNodeJsVersionForLogExecutionID} and above. Your current version is ${nodeVersion}. Please upgrade.`
0 commit comments