NEQTO Docs
  • Languages iconEnglish
    • 日本語
  • Docs
  • API
  • FAQ

›neqto.js

Getting Started

  • NEQTO Hello World!
  • Tutorial Step 1. NEQTO Console Setting
  • Tutorial Step 2. Device Settings & Launching Service (NEQTO Bridge)
  • Tutorial Step 2. Device Settings & Launching Service (STM32 Discovery)
  • Tutorial Step 2. Device Settings & Launching Service (SPRESENSE)
  • Tutorial Step 3. Application development using scripts

NEQTO

  • NEQTO Account Registration
  • Sub-accounts
  • API Usage
  • NEQTO CloudSync for GCP
  • NEQTO Engine Firmware List
  • Support Guidelines

NEQTO Console

  • Introduction
  • Fundamentals
  • Administrative Actions
  • Device Management
  • Linux-based Device Management
  • Batch Registration
  • Scripts
  • Actions and Contacts
  • View Data from the Console
  • NEQTO Apps

    • About NEQTO Apps
    • NEQTO Infinitypool
    • NEQTO Insights
    • NEQTO Custodia
    • NEQTO Flow
  • Machine Driver
  • Recommended Browsers
  • Billing Information

SPRESENSE

    Hardware Specifications

    • 01. About Spresense

    Software Specifications

    • 01. Operational Flow
    • 02. Initial Installation
    • 03. Spresense Wi-Fi Initial Setup
    • 04. Spresense LTE-M Initial Setup
    • 05. Debug Log Acquisition
    • 06. System LED Indications
    • 07. Event Messages
    • 08. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. GPIO
    • 12. UART
    • 13. SPI
    • 14. I2C
    • 15. ADC
    • 16. GNSS
    • 17. Camera
    • 18. Utils
    • 19. nqSpresense
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi
    • 24. nqLte

STM32 Discovery

    Hardware Specifications

    • 01. About STM32 Discovery Kit (B-L4S5I-IOT01A)

    Software Specifications

    • 01. Operational Flow
    • 02. Initial Installation
    • 03. STM32 Discovery Wi-Fi Initial Setup
    • 04. Debug Log Acquisition
    • 05. System LED Indications
    • 06. Event Messages
    • 07. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. UserSW
    • 12. GPIO
    • 13. UART
    • 14. SPI
    • 15. I2C
    • 16. ADC
    • 18. Utils
    • 19. nqDiscovery
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi

NEQTO Bridge

    Hardware Specifications

    • 01. NEQTO Bridge Module
    • 02. NEQTO Bridge Wi-Fi Module
    • 03. NEQTO Bridge LTE-1 Module
    • 04. NEQTO Bridge LTE-M/NB Module
    • 05. NEQTO Bridge IO Board
    • 06. NEQTO Bridge Digital IO Board
    • 07. NEQTO Bridge Connector Board

    Software Specifications

    • 01. Operational Flow
    • 02. NEQTO Bridge Wi-Fi Module Initial Setup
    • 03. NEQTO Bridge LTE Module Initial Setup
    • 04. Debug Log Acquisition
    • 05. System LED Indications
    • 06. Event Messages
    • 07. Updating Firmware

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. Sleep
    • 10. RTC
    • 11. UserSW
    • 12. GPIO
    • 13. UART
    • 14. SPI
    • 15. I2C
    • 16. ADC
    • 17. BLE
    • 18. Utils
    • 19. nqBridge
    • 20. nqService
    • 21. nqMqtt
    • 22. nqFOTA
    • 23. nqWiFi
    • 24. nqLte
    • 25. nqLAN
    • 26. nqEx

Linux-based device

    Software Specifications

    • 01. System Requirements
    • 02. Installation
    • 03. Software Configurations
    • 04. Operational Flow
    • 05. Debug Log Acquisition
    • 06. Event Messages
    • 07. Updating Software

    neqto.js

    • 01. About neqto.js
    • 02. Log
    • 03. Timers
    • 04. HTTP
    • 05. HTTPS
    • 06. MQTT
    • 07. Secure
    • 08. Storage
    • 09. RTC
    • 10. UNIXSocket
    • 11. FileSystem
    • 12. SubProcess
    • 13. Utils
    • 14. nqLinux
    • 15. nqService
    • 16. nqMqtt
    • 17. nqFOTA
    • 18. nqLAN

neqto.js Libraries

  • About neqto.js Libraries
  • UART

    • GM65 Barcode Reader
    • SRF Ultrasonic Range Finder - Serial Mode

    I2C

    • HTS221 v2 Temperature and Humidity Sensor
    • LIS2DW12 v2 Accelerometer
    • SRF Ultrasonic Range Finder - I2C Mode
    • [Archive] HTS221 Temperature and Humidity Sensor
    • [Archive] LIS2DW12 Accelerometer

    Utils

    • RTC Alarm Synchronized Scheduler

    Integration

    • AWS S3 v2
    • AWS IoT Core v2
    • Azure IoT v2
    • GCP IoT Core
    • [Archive] AWS S3
    • [Archive] AWS IoT Core

neqto.js Snippets

  • About neqto.js Snippets
  • DataDog
  • Dropbox
  • Google Sheets
  • InfluxDB
  • Oracle Cloud Object Storage
  • Salesforce
  • SAP Cloud Platform Internet of Things
  • Splunk
  • Niagara

Release Notes

  • NEQTO Console Updates
  • NEQTO Firmware (Bridge Wi-Fi/LTE Module) Releases
  • NEQTO Firmware (STM32 Discovery Wi-Fi) Releases
  • NEQTO Firmware (Spresense Wi-Fi/LTE-M) Releases
  • NEQTO Engine for Linux Releases

02. Log

The log object is a built-in extension object that provides logging output functionality.

Functional overview:

  • Able to set output level of the system log.
  • Able to set log output destination.
  • Allows logging arbitrary messages with JavaScript.

Limitations:

  • The maximum storage capacity of the non-volatile memory for logs is 366KB.
    When full, the old log is overwritten.



log Global Object

Methods()/PropertiesSummaryVersionNote
log.setLevel() Sets the level and the output destination of the system log.01.00.00+
log.clear() Clears logs stored in non-volatile memory.01.00.00+
log.getStoredSize() Gets the size of the currently saved log.01.00.00+
log.getStorageSize() Gets the storage size available for logs.01.00.00+
log.printLevel() Sets the output destination of the print() function.01.00.00+
print() Prints the log message.01.00.00+This is a globally scoped function.



Details

log.setLevel([level[,output[,instance]]])

Sets the level and the output destination of the system log.
The last set value is saved in non-volatile memory.
Therefore, it is possible to simply leave the system log disabled. This method is used to investigate potential causes when unexpected behaviors occur.

NameTypeM/OSummary                                  Note
levelnumberoptionalLog level setting
-1: Disabled
0: Error level
1: Warning level
2: Debug level
3: Trace level
The default value is -1.
outputnumberoptionalOutput destination setting
0: All disabled
1: Saves the log to the non-volatile memory on the NEQTO device
2: Outputs the log from the serial port of NEQTO device
3: Enable 1 and 2
4: Sends the log to NEQTO Console in real time
5: Enable 1 and 4
6: Enable 2 and 4
7: Enable 1, 2 and 4
The default value is 0.
Version 01.00.01+
4 or above: Version 01.03.00+

The "Send log to NEQTO Console in real time" function should be used for debugging purposes only. Since this function uses many communication resources, it may increase the processing load on the device and cause data transmission delays. In addition, as there are no retransmission processes in cases of communication failures, it may result in lost log data.
instancenumberoptional,
mandatory
Specify the instance ID to which the real-time log will be sent on the NEQTO Console.
For the available range of instance IDs, refer here.
Version 01.03.00+
It is mandatory only if 'output' is 4 or above.

Real-time logs will be sent to the NEQTO Console using the following MQTT specification:
ItemSetting value
Object IDAddressable Text Display (Fixed)
Instance IDAny
Resource IDText (Fixed)
returnundefined--When an error occurs, an exception is raised.

log.clear()

Clears the logs stored in non-volatile memory.

NameTypeM/OSummaryNote
returnundefined--

log.getStoredSize()

Gets the size of the currently saved log.

NameTypeM/OSummaryNote
returnnumber-Log size currently saved [byte].

log.getStorageSize()

Gets the amount of storage available to save logs.

NameTypeM/OSummaryNote
returnnumber-Log size that can be saved [byte].

log.printLevel([output[,instance]])

Sets the output destination of the print() function.
This print level is always initialized with default values at the start of script execution.

NameTypeM/OSummary                                  Note
outputnumberoptionalOutput destination setting
0: All disabled
1: Saves the log to the non-volatile memory on the NEQTO device
2: Outputs the log from the serial port of NEQTO device
3: Enable 1 and 2
4: Sends the log to NEQTO Console in real time
5: Enable 1 and 4
6: Enable 2 and 4
7: Enable 1, 2 and 4
The default value is 0.
After version 01.00.01, the default value is 2 when started in User Console mode.
4 or above: Version 01.03.00+

The "Send log to NEQTO Console in real time" function should be used for debugging purposes only. Since this function uses many communication resources, it may increase the processing load on the device and cause data transmission delays. In addition, as there are no retransmission processes in cases of communication failures, it may result in lost log data.
instancenumberoptional,
mandatory
Specify the instance ID to which the real-time log will be sent on the NEQTO Console.
For the available range of instance IDs, refer here.
Version 01.03.00+
It is mandatory only if 'output' is 4 or above.

Real-time logs will be sent to the NEQTO Console using the following MQTT specification:
ItemSetting value
Object IDAddressable Text Display (Fixed)
Instance IDAny
Resource IDText (Fixed)
returnundefined--When an error occurs, an exception is raised.

print(logMsg)

Prints the log message.

NameTypeM/OSummaryNote
logMsgstringmandatoryMessage to output as log.
returnundefined--When an error occurs, an exception is raised.



Object Usage Examples

Sample 1

This is a sample that outputs the system log and print log from the serial port of NEQTO device.

log.setLevel(0,2);
log.printLevel(2);

Sample 2

This is a sample that sends the system log and print log to NEQTO Console in real time.
The instance ID is an arbitrary value. It is also possible to use the same ID for the system log and the print log.
Available from FW version 01.03.00 or later.

log.setLevel(0,4,1);
log.printLevel(4,2);
//log.printLevel(4,1); /*Available*/



Updated: 2021-05-07
← 01. About neqto.js03. Timers →
  • log Global Object
  • Details
    • log.setLevel([level[,output[,instance]]])
    • log.clear()
    • log.getStoredSize()
    • log.getStorageSize()
    • log.printLevel([output[,instance]])
    • print(logMsg)
  • Object Usage Examples
    • Sample 1
    • Sample 2
AboutNewsProductsFAQPrivacy Policy}
NEQTO Console
IntroductionFundamentalsAdministrative ActionsDevice Management NEQTO Apps
NEQTO Bridge
NEQTO Bridge ModuleNEQTO Bridge Wi-Fi ModuleNEQTO Bridge LTE-1 ModuleError Logging Event Messages
API Documentation
API UsageGlobal APIRegional APIAPI Terms of Service
Jigsaw, Inc.
© 2023 JIG-SAW INC.