# Seeing the node-red logs when running node-red-node-test-helper

**URL:** https://discourse.nodered.org/t/seeing-the-node-red-logs-when-running-node-red-node-test-helper/14397
**Category:** General
**Created:** [16 August 2019 14:41 UTC](https://discourse.nodered.org/t/seeing-the-node-red-logs-when-running-node-red-node-test-helper/14397 "2019-08-16T14:41:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kolban](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kolban/32/10366_2.png) [@kolban](https://discourse.nodered.org/u/kolban)
#### Post date: [16 August 2019 14:41 UTC](https://discourse.nodered.org/t/seeing-the-node-red-logs-when-running-node-red-node-test-helper/14397/1 "2019-08-16T14:41:02Z")

</div>

As I build out a new set of contributed node implementations for Node-RED, I find myself using node-red-node-test-helper for the first time. I'm enjoying the function and all is well for the most part. I am gaining skills on the framework.

In one of my tests, I am invoking a flow and it is not working as expected. I feel that my flow and its corresponding custom node are being invoked but I get the feeling that my own code in my own node may be throwing an exception. This leads me to the question to be posed in this thread:

Is it possible to dump/log the messages generated by the execution of the flow that is invoked by node-red-node-test-helper?

In my test code I have:

```auto
const flow = [
  {
    "id": "n1",
    "type": "google-cloud-pubsub out",
    //"topic": "node-red-topic",
    "keyFilename": "/home/kolban/node-red/creds.json",
  }
];
helper.load(pubsubInNode, flow, () => {
  // At this point the flow is "running". We now need to send in some data.
  const n1 = helper.getNode("n1");

  console.log('About to fire flow');
  n1.receive({payload: text});
  ...

```

When I call `helper.load()`, my supposition is that an instance of Node-RED (or some core of it) is loaded and the flow passed to it. If I were running Node-RED from the command line, I would be able to look at its logs. Is it possible to see the logs of Node-RED itself when launched from `helper.load()`?

---

<div class="post-metadata">

### Author: ![kolban](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kolban/32/10366_2.png) [@kolban](https://discourse.nodered.org/u/kolban)
#### Post date: [25 August 2019 18:29 UTC](https://discourse.nodered.org/t/seeing-the-node-red-logs-when-running-node-red-node-test-helper/14397/2 "2019-08-25T18:29:59Z")

</div>

Soft bump ... I'm quite a fan of the node-red-node-test-helper framework but could really use some technique to see the underlying Node-RED logs when the framework runs flows.

---

<div class="post-metadata">

### Author: ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)
#### Post date: [25 August 2019 19:38 UTC](https://discourse.nodered.org/t/seeing-the-node-red-logs-when-running-node-red-node-test-helper/14397/3 "2019-08-25T19:38:45Z")

</div>

You may need to bump it again on Wednesday when I'm back from holiday and can dig out the code to remember how to do this.

---

<div class="post-metadata">

### Author: ![eastling](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eastling/32/39127_2.png) [@eastling](https://discourse.nodered.org/u/eastling)
#### Post date: [26 August 2021 08:12 UTC](https://discourse.nodered.org/t/seeing-the-node-red-logs-when-running-node-red-node-test-helper/14397/4 "2021-08-26T08:12:58Z")

</div>

Bumping this as I am wondering the same thing 🙂  
Many thanks in advance.

---

<div class="post-metadata">

### Author: ![andreasmarkussen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andreasmarkussen/32/51662_2.png) [@andreasmarkussen](https://discourse.nodered.org/u/andreasmarkussen)
#### Post date: [14 March 2023 12:59 UTC](https://discourse.nodered.org/t/seeing-the-node-red-logs-when-running-node-red-node-test-helper/14397/5 "2023-03-14T12:59:34Z")

</div>

So what I found out was this

```
helper.load([scannerNode, statusBrokerNode], flow, function () {
  console.table(helper.log().args.map(e=>e[0]))
  console.log('Current Log messages (all levels)', helper.log().args)
  console.log('Current Log messages (fatal, error, warn, info)', helper.log().args.filter((event) => event[0].level >= 40))
  var sNode = helper.getNode('dxBarcodeScanner.1');
  sNode.should.have.property('name', 'barcode1');
  helper.settings({ });
  done();
});

```
