Domi04151309

Arduino Board

What is Arduino?

Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs and turn it into an output. You can tell your board what to do by sending a set of instructions to the microcontroller on the board.

To the Arduino Homepage

About the Library

This library allows you to log actions in the serial monitor. It was developed by Dominik Reichl in 2018 and designed for Arduino boards.
This library is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.

You can download the library here

How to Install

1. Download the repository from GitHub
2. Unzip it
3. Copy the "Arduino-Loggong-Library-master" folder into your library folder
4. Open the Arduino IDE
5. Click on Sketch > Include Library > Logging
Done!

Functions

const LOG_DEBUG

Constant for the println function.

const LOG_ERROR

Constant for the println function.

const LOG_INFO

Constant for the println function.

const LOG_VERBOSE

Constant for the println function.

const LOG_WARN

Constant for the println function.

class Log

The main class of this library.

void d(String tag, String msg)

Prints a debug message to the serial monitor.

void e(String tag, String msg)

Prints an error message to the serial monitor.

void i(String tag, String msg)

Prints an info message to the serial monitor.

void v(String tag, String msg)

Prints a verbose message to the serial monitor.

void w(String tag, String msg)

Prints a warning message to the serial monitor.

void wtf(String tag, String msg)

Prints a wtf message to the serial monitor.

void println(uint8_t priority, String tag, String msg)

Prints a message with the chosen priority to the serial monitor.

Example

#include <Logging.h>

Log Log;

void setup() {
  Serial.begin(9600);
}

void loop() {
  Log.d("Tag", "Text");
  Log.e("Tag", "Text");
  Log.i("Tag", "Text");
  Log.v("Tag", "Text");
  Log.w("Tag", "Text");
  Log.wtf("Tag", "Text");
  Serial.println();
  delay(5000);
  Log.println(LOG_DEBUG, "Tag", "Text");
  Log.println(LOG_ERROR, "Tag", "Text");
  Log.println(LOG_INFO, "Tag", "Text");
  Log.println(LOG_VERBOSE, "Tag", "Text");
  Log.println(LOG_WARN, "Tag", "Text");
  Log.wtf("Tag", "Text");
  Serial.println();
  delay(5000);
}