GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - janLo/ArduinoSimpleLogging: Log framework for Arduino supporting levels and handlers.

BranchesTags
Open more actions menu

Latest commit

 

History

21 Commits
21 Commits

Folders and files

NameName
Last commit message
Last commit date
examples/log_serial
examples/log_serial
 
 
src
src
 
 
.travis.yml
.travis.yml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
keywords.txt
keywords.txt
 
 
library.json
library.json
 
 
library.properties
library.properties
 
 

Repository files navigation

ArduinoSimpleLogging

Simple logging-framework for Arduino supporting levels and handlers.

It provides a static Logger instance that has static Print instances as members. These members are debug, info, warning and error and represent preconfigured log targets for the available log levels.

As these are Print instances, you can use them as drop-in-replacement for Serial. For example instead of Serial.println("Hello") you just write Logger.debug.println("Hello"). This will print the String Hello to all streams that are configured for DEBUG.

To configure a Print instance for a log level you simply add it as log handler. For example, to log all log messages to Serial you need to call:

Logger.addHandler(Logger.DEBUG, Serial);

Log levels are including. That means, that when you configure a handler for a certain level, you'll get everything up to this level. The available levels are: ERROR, WARNING, INFO, DEBUG with debug the highest level. So if you configure your Handler for DEBUG, you'll get messages for all levels. If you configure for ERROR, you'll get only error messages.

Line- or message buffering

The template LineBufferProxy implements a simple proxy to buffer messages and send them line- or messagewise to some target. Simply inherit from it and implement the flush() method. It is called when either the internal buffer is full or the Sep char was found. The String it gets is always null terminated. The size() can be used if the length is needed. So you can save the time of a strlen().

About

Log framework for Arduino supporting levels and handlers.

Resources

Readme
MIT license
Activity

Stars

5 stars

Watchers

3 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.