#Requesting a change to the standard library
1 messages · Page 1 of 1 (latest)
you can open a regular issue, choose "blank issue" when creating the issue. the only thing that is off limits is language proposals
but if it's a small thing you'd like to fix yourself it's usually also fine to open a PR directly
if it's something you think you want to discuss with the core team first you can chat with them on https://zsf.zulipchat.com/
Official Zulip server for collaborating on the standard library, compiler development, and ecosystem. Coordinate with others and ask for assistance here if your goal is to contribute to the project. | This server is not for general chit chat or socializing - it is for focused software development efforts. There is no "offtopic" channel. All skil...
You can also run it by people in this server
Which I would recommend if you’re not an experienced Zig programmer
it is very simple, basically the mappings between color enums and the associated []const u8 cannot be queried because they are inside a function which makes you use a "writer". I think it would make more sense to maintain the current function but allow the direct retrieval of the data via a function that just returns a []const u8. Imo there is no point to restrict something so simple behind a single data structure. Does that make any sense?
I am still a beginner in zig, so I don't know
I tried a zig a long time ago but never really got into it, but now I'm coming back around 😆
std.io.tty also supports windows console iirc, which doesn't use escape codes
so there isn't always a []const u8 to map to
as always, windows is weird :)
I saw that it was using a separate function but it didn't register in my brain. I kind of assumed it was just data, similar to ansi
Well, it's not like I'm going to target windows anyway
I'll just copy the escape codes 🙃
if you're not using std.io.tty it's probably because you're doing something more advanced, so you'll need to write your own escape codes anyway
yeah true. I'm just creating a special logging module for my toolkit and want to highlight the words "CRITICAL" in purple, "WARNING" in yellow, etc. So like this:
std.debug.lockStdErr();
defer std.debug.unlockStdErr();
nosuspend {
writer.print(
"[ztk/{s}]|[{}:{:0>2}:{:0>2}:{:0>8}]> {s}: " ++ format ++ "\n",
.{ self.module, hours, minutes, seconds, nanoseconds, level_txt } ++ args,
) catch return;
bw.flush() catch return;
}
I would wrap level_txt in that attribute
but yeah, thanks for the help
u can use std.io.tty for that, no?
actually yeah I suppose I could, I would just have to break it into 3 calls huh
yeah, that's fine tho
Sorry I've been awake for a long ass time
possibly more readable even