Skip to content

Commit

Permalink
Fix 'Cannot assign to 'level' because it is a constant or a read-only…
Browse files Browse the repository at this point in the history
… property.'

```
src/client.ts:186:10 - error TS2540: Cannot assign to 'level' because it is a constant or a read-only property.

186   logger.level = process.env.LOG_LEVEL || 'warn';
             ~~~~~

make: *** [Makefile:14: compile] Error 2
```

See microsoft/TypeScript#6751 (comment)
and https://stackoverflow.com/questions/38818475/left-hand-side-of-assignment-expression-cannot-be-a-constant-or-a-read-only-prop/38833920#38833920
  • Loading branch information
batmat committed Oct 17, 2018
1 parent 7eec987 commit 94c58a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distribution/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ if (require.main === module) {
* Allow the log level to be overridden in the environment for debugging
* purposes by the user
*/
logger.level = process.env.LOG_LEVEL || 'warn';
(logger as any).level = process.env.LOG_LEVEL || 'warn';
/* Main entrypoint for module */
UI.publish('Starting the evergreen-client..', { log: 'info' });
const client = new Client();
Expand Down

0 comments on commit 94c58a4

Please sign in to comment.