All Projects → christianhujer → sclog4c

christianhujer / sclog4c

Licence: LGPL-3.0 license
Simple configurable logging for C

Programming Languages

c
50402 projects - #5 most used programming language
Makefile
30231 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to sclog4c

Slog
Structured, contextual, extensible, composable logging for Rust
Stars: ✭ 1,068 (+5521.05%)
Mutual labels:  logging-library
Tracing
Application level tracing for Rust.
Stars: ✭ 1,294 (+6710.53%)
Mutual labels:  logging-library
Ring Log
Ring-Log是一个高效简洁的C++异步日志, 其特点是效率高(每秒支持至少125万+日志写入)、易拓展,尤其适用于频繁写日志的场景
Stars: ✭ 201 (+957.89%)
Mutual labels:  logging-library
Hslogger
Logging framework for Haskell
Stars: ✭ 60 (+215.79%)
Mutual labels:  logging-library
Diary
📑 Zero-dependency, fast logging library for both Node and Browser.
Stars: ✭ 79 (+315.79%)
Mutual labels:  logging-library
Nanolog
Nanolog is an extremely performant nanosecond scale logging system for C++ that exposes a simple printf-like API.
Stars: ✭ 1,710 (+8900%)
Mutual labels:  logging-library
Playaccesslogger
Generates access logs compatible with Apache httpd (enhanced combined format)
Stars: ✭ 21 (+10.53%)
Mutual labels:  logging-library
Timber Elixir
🌲 Great Elixir logging made easy
Stars: ✭ 226 (+1089.47%)
Mutual labels:  logging-library
Yurnalist
An elegant console reporter, borrowed from Yarn
Stars: ✭ 88 (+363.16%)
Mutual labels:  logging-library
Logging
Microsoft Extension Logging implementation for Blazor
Stars: ✭ 165 (+768.42%)
Mutual labels:  logging-library
Logginginterceptor
An OkHttp interceptor which has pretty logger for request and response. +Mock support
Stars: ✭ 1,149 (+5947.37%)
Mutual labels:  logging-library
Evergreen
Most natural Swift logging
Stars: ✭ 75 (+294.74%)
Mutual labels:  logging-library
Cscore
cscore is a minimal-footprint library providing commonly used helpers & patterns for your C# projects. It can be used in both pure C# and Unity projects.
Stars: ✭ 115 (+505.26%)
Mutual labels:  logging-library
Simpleqtlogger
Simple rolling file logger for Qt.
Stars: ✭ 60 (+215.79%)
Mutual labels:  logging-library
Firephp Core
FirePHP server library for sending PHP variables to the browser.
Stars: ✭ 208 (+994.74%)
Mutual labels:  logging-library
Log4cplus
log4cplus is a simple to use C++ logging API providing thread-safe, flexible, and arbitrarily granular control over log management and configuration. It is modelled after the Java log4j API.
Stars: ✭ 1,054 (+5447.37%)
Mutual labels:  logging-library
Spring Boot Logging
A library for logging HTTP request/response for Spring Boot application and integration with Elastic Stack
Stars: ✭ 92 (+384.21%)
Mutual labels:  logging-library
Loggerpro
An modern and pluggable logging framework for Delphi
Stars: ✭ 231 (+1115.79%)
Mutual labels:  logging-library
Coldbox Platform
A modern, fluent and conventions based HMVC framework for ColdFusion (CFML)
Stars: ✭ 220 (+1057.89%)
Mutual labels:  logging-library
Json Logging Python
Python logging library to emit JSON log that can be easily indexed and searchable by logging infrastructure such as ELK, EFK, AWS Cloudwatch, GCP Stackdriver
Stars: ✭ 143 (+652.63%)
Mutual labels:  logging-library

sclog4c

C CI

Simple configurable logging for C.

Compiler Support

Supported

  • GCC Tested versions: 4.5.2, 4.9.1, 5.3.1, 7.5.0 Any version 4.5.2 or newer should work. Older versions probably work, too, as long as they implement __VA_ARGS__ and ##__VA_ARGS__. To build with gcc, simply use make on systems where GCC is default, otherwise use make CC=gcc.
  • clang Tested versions: 3.5.0, 6.0.0 Any version 3.5.0 or newer should work. Older versions probably work, too, as long as they implement __VA_ARGS__ and ##_VA_ARGS__. To build with clang, simply use make CC=clang.
  • armcc Tested version: 5.10
  • Visual Studio Not tested Any version Visual Studio 2005 or newer should work.

Support Incomplete

compilation works, but logging doesn't work:

  • Keil C251 Tested version: V5.55.0.0 Gives warning message if logm() is used with format arguments.

Support Planned

  • Intel
  • Keil C166
  • Keil C51
  • UCC
  • NetBeans
  • Open64
  • Solaris Studio
  • PC-Lint (if somebody sponsors it)

Features

Implemented Features

  • API similar to java.util.logging - easy to learn, easy to use.
  • Tiny
  • Runtime loglevel configuration
  • Formattable log message
  • Tries to print the log message in a single fprintf() call. This is important for multitasking and multithreading to prevent distorted output. This only works if the compiler supports a form of ##__VA_ARGS__, i.e. doesn't fall over if an empty __VA_ARGS__ is used after comma.
  • Compile-time loglevel configuration via macro SCLOG4C_LEVEL for code size reduction. You can specify SCLOG4C_LEVEL on a per-module basis, like xzy.o: CPPFLAGS+=-DSCLOG4C_LEVEL=SL4C_DEBUG in your Makefile. Note: In order for this feature to work nicely, it's expected that the compiler removes dead code. You can check if your compiler does so by telling your compiler to keep temp files (for gcc and clang this is CFLAGS+=-save-temps) and look at the assembly file (usually .s).

Planned Features

  • Per-module-logging
  • Tiny logging for embedded devices with severely resource constraint environments (i.e. 8051).
  • API Improvements

Features Not Planned

  • XML configuration file, XML logging. This is a simple logging framework. If you're looking for something powerful, like a "Log4J" for C, use log4c or zlog.

Usage

To use sclog4c, #include <sclog4c/sclog4c.h> at the start of your source file. Invoke the logm() macro to perform logging. Use the sclog4c_level variable to control the log level at runtime (defaults to SL4C_ALL). Use the SCLOG4C_LEVEL macro to control the log level at compile time (defaults to SL4C_WARNING).

Example:

#include <sclog4c/sclog4c.h>

int main(int argc, char *argv[])
{
    sclog4c_level = SL4C_ALL;
    logm(SL4C_DEBUG, "Program name: %s", argv[0]);
    return 0;
}

Other logging frameworks for C

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].