mirror of
https://git.robbyzambito.me/zits
synced 2026-02-04 03:34:48 +00:00
scope parse logger
also change internal name to match public name
This commit is contained in:
@@ -7,7 +7,7 @@ const Writer = std.Io.Writer;
|
||||
const AllocatingWriter = std.Io.Writer.Allocating;
|
||||
const StaticStringMap = std.StaticStringMap;
|
||||
|
||||
const log = std.log;
|
||||
const log = std.log.scoped(.zits);
|
||||
|
||||
const isDigit = std.ascii.isDigit;
|
||||
const isUpper = std.ascii.isUpper;
|
||||
@@ -19,7 +19,7 @@ const message = @import("./parse/message.zig");
|
||||
pub const Message = message.Message;
|
||||
pub const Payload = @import("./parse/Payload.zig");
|
||||
|
||||
const client_types = StaticStringMap(message.Control).initComptime(
|
||||
const client_control = StaticStringMap(message.Control).initComptime(
|
||||
.{
|
||||
// {"INFO", .info},
|
||||
.{ @tagName(.CONNECT), .CONNECT },
|
||||
@@ -36,7 +36,7 @@ const client_types = StaticStringMap(message.Control).initComptime(
|
||||
},
|
||||
);
|
||||
fn parseStaticStringMap(input: []const u8) ?message.Control {
|
||||
return client_types.get(input);
|
||||
return client_control.get(input);
|
||||
}
|
||||
|
||||
/// Parse a string into its associated MessageType.
|
||||
@@ -47,7 +47,7 @@ pub fn next(alloc: Allocator, in: *Reader) !Message {
|
||||
var operation_string: ArrayList(u8) = blk: {
|
||||
comptime var buf_len = 0;
|
||||
comptime {
|
||||
for (client_types.keys()) |key| {
|
||||
for (client_control.keys()) |key| {
|
||||
buf_len = @max(buf_len, key.len);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user