# Logs

A great debugging resource is the ability to view the logs of your function. To do so, refer to the left side bar and select the "logs" icon as shown below to view the history of your Function's executions:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Fm5rmvN8bqNp82vhevZIW%2Fimage.png?alt=media&#x26;token=b73358da-99ee-41c2-9307-5bb4b8529697" alt=""><figcaption></figcaption></figure>

In the Function's logs, you can confirm data was successfully posted to Ubidots with the **201** response code:

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FZwOMVcVvsB14lIhZbTb0%2Fimage.png?alt=media&#x26;token=0573fc87-c245-49f2-b911-a7dc3d88bfa1" alt=""><figcaption></figcaption></figure>

This is what your function returns. It must be in a JSON dictionary format. In your code, make sure to use **return** to quit the function and return the dictionary.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Fw9115XwiecGDz4qy299a%2Fimage.png?alt=media&#x26;token=e30d6203-d4a9-4ab8-a008-c0580a2c56f8" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="NodeJS" %}

```javascript
return response.data;
```

{% endtab %}

{% tab title="Python" %}

```python
return {"status": "Ok", "result": req.json()}
```

{% endtab %}
{% endtabs %}

This is used to debug purposes, you can print any kind of variables defined before in it or to just print any message that needs to be displayed to the user.

<figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2FR1obT6T7PQBvTQNRUG9W%2Fimage.png?alt=media&#x26;token=bf2fdd05-aad7-4b92-affa-2878a88ddea6" alt=""><figcaption></figcaption></figure>

{% tabs %}
{% tab title="NodeJS" %}

```javascript
console.log("[INFO] Request result:");
console.log(response);
```

{% endtab %}

{% tab title="Python" %}

```python
print("[INFO] Request result:")
print(req.text)
```

{% endtab %}
{% endtabs %}
