All Projects → MengRao → NanoLogLite

MengRao / NanoLogLite

Licence: MIT License
A revised version of NanoLog which writes human readable log file, and is easier to use.

Programming Languages

C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to NanoLogLite

Nanolog
Nanolog is an extremely performant nanosecond scale logging system for C++ that exposes a simple printf-like API.
Stars: ✭ 1,710 (+9400%)
Mutual labels:  high-performance, logging-library, low-latency
Quill
Asynchronous Low Latency C++ Logging Library
Stars: ✭ 422 (+2244.44%)
Mutual labels:  logging-library, low-latency
Emitter
High performance, distributed and low latency publish-subscribe platform.
Stars: ✭ 3,130 (+17288.89%)
Mutual labels:  high-performance, low-latency
Reveno
⚡ High performance and low latency Event Sourcing/CQRS framework
Stars: ✭ 283 (+1472.22%)
Mutual labels:  high-performance, low-latency
Atomic queue
C++ lockless queue.
Stars: ✭ 373 (+1972.22%)
Mutual labels:  high-performance, low-latency
clue
a extremely high performance log library for android. 高性能的Android日志库
Stars: ✭ 27 (+50%)
Mutual labels:  high-performance, logging-library
Object threadsafe
We make any object thread-safe and std::shared_mutex 10 times faster to achieve the speed of lock-free algorithms on >85% reads
Stars: ✭ 280 (+1455.56%)
Mutual labels:  high-performance, low-latency
Blog
Java Performance
Stars: ✭ 83 (+361.11%)
Mutual labels:  high-performance, low-latency
Sharedhashfile
Share Hash Tables With Stable Key Hints Stored In Memory Mapped Files Between Arbitrary Processes
Stars: ✭ 380 (+2011.11%)
Mutual labels:  high-performance, logging-library
LruClockCache
A low-latency LRU approximation cache in C++ using CLOCK second-chance algorithm. Multi level cache too. Up to 2.5 billion lookups per second.
Stars: ✭ 35 (+94.44%)
Mutual labels:  high-performance, low-latency
cachegrand
cachegrand is an open-source fast, scalable and secure Key-Value store, also fully compatible with Redis protocol, designed from the ground up to take advantage of modern hardware vertical scalability, able to provide better performance and a larger cache at lower cost, without losing focus on distributed systems.
Stars: ✭ 87 (+383.33%)
Mutual labels:  high-performance, low-latency
radondb-mysql-kubernetes
Open Source,High Availability Cluster,based on MySQL
Stars: ✭ 146 (+711.11%)
Mutual labels:  high-performance
laav
Asynchronous Audio / Video Library for H264 / MJPEG / OPUS / AAC / MP2 encoding, transcoding, recording and streaming from live sources
Stars: ✭ 50 (+177.78%)
Mutual labels:  low-latency
webgui
Web Technologies based Crossplatform GUI Framework with Dark theme
Stars: ✭ 81 (+350%)
Mutual labels:  high-performance
epump
ePump是一个基于I/O事件通知、非阻塞通信、多路复用、多线程等机制开发的事件驱动模型的 C 语言应用开发框架,利用该框架可以很容易地开发出高性能、大并发连接的服务器程序。
Stars: ✭ 26 (+44.44%)
Mutual labels:  high-performance
Lighty
Easy to use and lightweight logger for iOS, macOS, tvOS, watchOS and Linux in Swift.
Stars: ✭ 49 (+172.22%)
Mutual labels:  logging-library
FastRationals.jl
Arithmetic with small and with very large rationals is made fast.
Stars: ✭ 15 (-16.67%)
Mutual labels:  high-performance
tinylogger
Lightweight logging framework for bash
Stars: ✭ 35 (+94.44%)
Mutual labels:  logging-library
Apulis-AI-Platform
The AI platform is designed to provide an end-to-end AI solution to users from different industries and enable them to start the high-performance AI development work with significantly reduced ramp up time, thereby saving costs and improving efficie.
Stars: ✭ 50 (+177.78%)
Mutual labels:  high-performance
moesif-nodejs
Moesif Nodejs Middleware Library (formerly Moesif-Express)
Stars: ✭ 36 (+100%)
Mutual labels:  logging-library

NanoLogLite is no longer under maintenance as there's a better alternative library fmtlog which is easier to use and more performant, thus I suggest user switch to the latter.

NanoLogLite

NanoLogLite is a revised version of NanoLog, and is easier to use without performance compromise.

The major changes are:

  • NanoLogLite writes directly in human readable format instead of writing to a binary file and needing an additional decoder for reading, this behaves like other log libraries.
  • User can now register a log msg callback function. This is useful in circumstances where warning/error msgs need to be published out for alerting.
  • NanoLogLite won't create a default log file before user calling NanoLog::setLogFile.
  • Log msg header is improved: NanoLogLite by default sets a meaningful thread id, and also allows user to customize the thread name; Time string is shortened, and folder part is removed from the file path.
  • NanoLogLite won't create background thread internally, it requires user to poll it periodically. The idea is that user should have the ability to manage the threads in their program. This would not make it harder to use as the user can simply create a thread himself to poll if he doesn't care.
  • Some shortcut macros are added for easier writing logging code: logd, logi, logw, loge for logging DEBUG/INFO/WARNING/ERROR msgs respectively.
  • Log timestamp precision is much improved, it's almost synchronized with system time.
  • Performance is improve a little as the Stagging buffer is re-implemented.

Examples of the new features:

// easier to write log msg
logi("Simple log message with 1 parameters, %d", i);

// set a meaningful name for current thread
NanoLog::setThreadName("main"); 

// set a callback/hook to capture msgs with WARNING or above log level
void logcb(uint64_t ns, NanoLog::LogLevel level, const char* msg, size_t msg_len) {
  printf("logcb, ns: %ld, msg: %s\n", ns, msg);
}

// we can set a minimum callback interval(in seconds) for each msg, 0 here means no such limitation
NanoLog::setLogCB(logcb, NanoLog::WARNING, 0);

// user need to poll it
NanoLog::poll(); 

image

Test

Check log_test.cc for example usage.

How to build static library

Simply delete SHARED in CMakeLists.txt.

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].