News for hackers. Stuff that matters.

PenguineDavid

Show HN: C++, Java and C# Light-Weight-Logger

https://github.com/PenguineDavid/light-weight-logger

This is a Library I've been working on with versions for C++, java & C# where you make custom formats and Log based on them, for example you could make an ERROR Like this:[ERROR] [date, time-stamp, time-zone] <main log message> (file:thread-ID:line)but you would write it like this:// define the master formatmaster_style = "%C[%N]%c%S%G[%D %T %Z]%c %M %G(%F:%t:%L)";// tell the logger...

( Read More... | no comments | 2 points | on HN )
Re:Show HN: C++, Java and C# Light-Weight-Logger on Tuesday June 30, 2026 @07:03AM (#48730924)
darn it I was gonna make a show HN for that link now I can't cuz I can't use the same link twice...
Re:Show HN: C++, Java and C# Light-Weight-Logger on Tuesday June 30, 2026 @06:58AM (#48730874)
I may have accidentally put the link to the wrong repo it's at https://github.com/PenguineDavid/light-weight-logger

This is a Library I've been working on with versions for C++, java & C# where you make custom formats and Log based on them, for example you could make an ERROR Like this:

[ERROR] [date, time-stamp, time-zone] <main log message> (file:thread-ID:line)

but you would write it like this:

// define the master format

master_style = "%C[%N]%c%S%G[%D %T %Z]%c %M %G(%F:%t:%L)";

// tell the logger what colour to use for a given name

logger.add_format("ERROR", master_style, Colour::RED);

so now the [ERROR] part will be red, the time area will be grey, and the location grey, but you could really make any style you wanted. And once you have a master format you could also add different types of logs:

logger.add_format("SUCCESS", style_minimal, Colour::GREEN); logger.add_format("INFO", master_style, Colour::CYAN); logger.add_format("WARN", master_style, Colour::YELLOW);

also the %S we put in there is actualy a colum padder so you logs will be inline:

[INFO] [16/06/2026 10:58:00 AUS Eastern Standard Time] Initializing core subsystem components. (src/main.cpp:1:39) [SUCCESS][16/06/2026 10:58:00 AUS Eastern Standard Time] Database connection established smoothly. (src/main.cpp:1:40) [WARN] [16/06/2026 10:58:00 AUS Eastern Standard Time] High memory usage detected on node cluster. (src/main.cpp:1:41) [ERROR] [16/06/2026 10:58:00 AUS Eastern Standard Time] Failed to write to write-ahead log! (src/main.cpp:1:42)

Re:Show HN: C++, Java and C# Light-Weight-Logger on Tuesday June 30, 2026 @06:56AM (#48730866)
I am an idiot sorry it's https://github.com/PenguineDavid/light-weight-logger new to HN can I edit my post?
Re:Ask HN: What are you working on? (June 2026) on Monday June 15, 2026 @08:35AM (#48540348)
Funny I was going to make a programming language called Glyph as well but than i discovered GlyphLang so I decided to call it Kith instead.
I like Firefox edge spams your face with thousands of adds tho the web developer tools on edge are nice.
I'm from Australia they took entirely the wrong approach not only do I think there are better options than just blanket banning social media including some educational content that maybe on YouTube to all under 16yrs, but even if it was the way they have done it you just can't make an account but you can still watch videos just no commenting & no subscribing.
Re:Firewood Splitting Simulator on Monday June 15, 2026 @06:35AM (#48539308)
This is really cool! I honestly spent like 30mins just cutting firewood.