Skip to content
/ Logga Public

A minimalistic embedded device logger for memory constrained devices. Can use SD card, external SPI memory, SPIFFS.

Notifications You must be signed in to change notification settings

bytecod3/Logga

Repository files navigation

Logga

Static Badge Static Badge Static Badge GitHub commit activity

A minimalistic data and event logging library built for both embedded and mainstream C programs

Features

  • Basic logging (TRACE, INFO, WARNING, CRITICAL, etc)
  • Supports real-world time via NTP
  • Support CPU time
  • File size check
  • Cyclic logging
  • Network log data dump
  • JSON format support
  • Fetch logs between specific periods of time/date etc
  • Follows MISRA-C standard

How it works

Usage

Copy the following files into your working directory:

1. config.h
2. logga.h
3. logga.cpp

Desktop

1. Create logging object

The code below shows how to create logging object:

yourfile.cpp


#include <iostream>
#include <stdint.h>
#include "logga.h"

//#define NLOG / to turn  on/off logging **/

#ifndef NLOG

#define LOG_FILE_SIZE
Logga_Type_t system_logger = create_logga(); /* create logger object */
const char* filename = "/log-file.log"; /* your logging filename */

#endif

int main() {
    #ifndef NLOG
        init_logga(system_logger, filename);
    #endif
    
    return 0;
}

Tests Done

ESP32

SPIFFS init


The library should work automatically with spiffs when using an ESP32 If the ESP32 SPIFFS is not recognized, please use the following resource to fix the issue: !(Set up spiffs on ESP32)[https://www.programmingelectronics.com/spiffs-esp32/]

Known issues

About

A minimalistic embedded device logger for memory constrained devices. Can use SD card, external SPI memory, SPIFFS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published