---
title: nrProcessMessage
source: https://docs.newrelic.com/docs/streaming-video-&-ads/installation/roku/agent-api/lifecycle/nrprocessmessage
---

## Syntax

```js
  nrProcessMessage(nr as Object, msg as Object) as Boolean
```

## Description

Check for a system log message, process it and sends the appropriate event.

## Arguments

| Arguments | Description                         |
| --------- | ----------------------------------- |
| `nr`      | New Relic Agent object.             |
| `msg`     | A message of type roSystemLogEvent. |

## Return

True if msg is a system log message, False otherwise.

## Example

```js
  	while (true)
		      msg = wait(0, m.port)
		      if nrProcessMessage(m.nr, msg) = false
			            if type(msg) = "roPosterScreenEvent"
				                  if msg.isScreenClosed()
					                        exit while
				                  end if
			            end if
		      end if
	  end while
```
