慣性聚合 高效追讀感興趣之博客、新聞、科技資訊
閱原文 以慣性聚合開啟

推薦訂閱源

博客园 - 司徒正美
V
V2EX
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
aimingoo的专栏
aimingoo的专栏
Apple Machine Learning Research
Apple Machine Learning Research
IT之家
IT之家
Blog — PlanetScale
Blog — PlanetScale
A
About on SuperTechFans
月光博客
月光博客
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
V
Visual Studio Blog
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python)
基于域的C++日志系统与Nova
Kleetus MacT · 2026-05-24 · via DEV Community

Kleetus MacTavish

乃 introduce Nova,一 Deterministic C++ 記錄庫,以領域為基礎之路由

倉庫:https://github.com/kmac-13/nova/
Benchmark:https://github.com/kmac-13/nova/blob/main/docs/BENCHMARKS.md

吾甚喜,乃宣布 Nova 之初始發布 - 乃现代C++之記錄庫,專注於確定性行為、編譯時配置之靈活,及基於領域之彈性路由,適用於從托管平台至裸機及安全關鍵環境之系統.

為何復有記錄庫?

今已有数种优质C++日志库。然多数日志库,其路由与过滤皆围绕严重等级而组织,且倚赖全局日志配置或运行时字符串式日志类别。工程师常被迫将子系统行为编码于有限之严重等级中,同时亦需考量生产环境中何种阈值将启用。此亦导致一种情形:为某一子系统启用调试日志,往往需于无关应用领域全面启用调试日志。

Nova则视日志域为编译时之类型,使日志配置与路由能直接映照应用结构,而非强令子系入于全局严重类别。

域可表子系统、模块、界面、类、库,或任何特定领域之概念,且各域可独立启用、禁用或路由,无需依赖共享之全局配置。盖因域为独立之类型,非共享之字符串标识,故库可自定其日志域,而弗扰应用或第三方之日志配置。

  • 类型定义之日志域——可依子系统、模块、类、库或任何其他概念而记录
  • 编译时剔除禁用之域——C++17语言保证,C++11/14依赖优化器
  • 编译时路由——避免依赖全局日志注册表或共享运行时配置

是库之附加目标者:

  • 简易流程,可扩展之API
  • 确定性行为——无堆,无异常,无运行时类型识别
  • 支援之广,自托管系统至裸机无所不包
  • 迅捷足以应实时与多线程之重负

Nova复含Flare,乃异步信号安全之崩溃与法医记录组件,能自信号处理程序直书结构化诊断之记于磁盘——不假堆分配,无锁,亦不用非信号安全之C++运行时特征。

#include <nova.h>

// define a domain (can be any type)
struct MotionPlanner {};  

// configure the domain with a name (MOTION), enabled state (true), and clock type (steadyNanosecs)
NOVA_LOGGER_TRAITS( MotionPlanner, MOTION, true, kmac::nova::TimestampHelper::steadyNanosecs );

int main()
{
    // configure motion planner sink as mpSink
    ...

    // bind the mpSink to the MotionPlanner logging domain
    kmac::nova::ScopedConfigurator config;
    config.bind< MotionPlanner >( &mpSink );

    // log
    NOVA_LOG( MotionPlanner ) << "Planning trajectory...";
}

入全屏模式 出全屏模式

于此可见,MotionPlanner之域既立,其性配置,目标之汇与之相系,而记事焉。此例中,域乃简素空疏之构,然域可为任一型,若接口、抽象、具体之类皆是。域乃至可为特定之类,而记事可限于此类之域。

以类型为日志域,可于编译时定路由,强分系统,及于域别设配置与启用。禁用之域,编译器可尽除之,而类型名可防字符串路由所引之默然运行时败。

复次,域别控制之故,使一系之详录,不涉他系——无共通之严级,可普升普降于全应用,惟欲察独区之细输出耳。

性能

Nova已与数种流行之C++详录库较验,如Quill及spdlog,所用者:

  • 众线程之数
  • 固定队列之大小
  • 持续吞吐之场景
  • 确保交付延迟之测试
  • 既实文件之汇流,复计数之汇流,以隔离I/O之开销

此基准测试有意使队列之大小与后端线程模型归一化,以避免结构上偏袒任何特定之库配置

结果因任务而异,然数端之理恒存:

  • Nova于有期交付之境及有界存配之设,尤显其能
  • Nova之同步汇流,远胜他库之可比同步配置
  • 诺瓦异步后端(用无I/O计数汇流)于线程数增减间,吞吐量犹胜,且每条记录皆无堆分配之耗。
  • 奎尔前端入队吞吐量极高,然持续超负荷时,失率甚巨。
  • spdlog异步于繁重多线程作业,性能渐衰。

虽诺瓦(Nova)非恒达最高理论前端队列速率,然其于广谱现实工作负载中,尤以确定性行为与内存使用有界处,表现殊为竞胜。

全量基准测试法及原始测试数据俱存于库中。

设计之旨

大义 述作
域路由 日志应反映应用结构,而非强令子系统归入全局严重性类别
确定性行为 设计上无堆分配、异常或RTTI——堆使用明确记录于存在之处(如少数便利性汇流处),而在Nova核心、Nova附加及Flare中处处避免之
交易权衡 缓冲与队列之大小,同步与异步之交付,阻塞与发散之行为,当显而可设
编译时之配置 日志之配置,宜于编译时解析之
面向生产之设计 优化持续真实之工作负载与运营可预见性
現代C++ 不增無謂之繁雜,亦無過重之依賴,而善用當代語言之特徵
性能為先之設計 記錄之負擔應穩定而輕微,尤以延遲敏感及多線程之系統為要

現狀& 評論

初版现已发布于上方链接之仓库。吾仍勤勉于增补新功能,如:

  • 增置之盂/后援
  • 裝束與融匯磨礪
  • 二进制日志

Nova之诸般,愿闻诸君之评,如整合之体验、跨平台编译之问题、功能之祈求等。倘诸君于项目中试用 Nova,愿闻其表现,及其可进之方。

诸君读此,谢矣。