How to use the log function from util

Find comprehensive JavaScript util.log code examples handpicked from public code repositorys.

375
376
377
378
379
380
381
382
383
384
stream.write('It works!'); // Received data: "It works!"
```


<div id="log" class="anchor"></div>
## util.log(string)

输出带时间戳的 `stdout`。

```javascript
fork icon21
star icon99
watch icon2

66
67
68
69
70
71
72
73
74
75
  var sha256 = checksum.substr(0, checksum.length - 4);
  var hash = crypto.createHash('sha256').update(data + salt).digest('hex');
  if (hash === sha256) {
    return true;
  } else {
    util.log("checksum is wrong");
    return false;
  }
} else {
  util.log("checksum not found");
fork icon0
star icon0
watch icon1

+ 2 other calls in file