build libnss_turbo.so.2.0.0

This commit is contained in:
2022-07-09 17:33:13 +03:00
parent 78ac541e49
commit 9f884b96f7
2 changed files with 53 additions and 18 deletions

View File

@@ -28,7 +28,7 @@ const ENV_OMIT_MEMBERS = "TURBONSS_OMIT_MEMBERS";
export var turbonss_db_path: [:0]const u8 = "/etc/turbonss/db.turbo";
pub var log_level: std.log.Level = .err;
//pub var log_level: std.log.Level = .err;
// State is a type of the global variable holding the process state:
// the DB handle and all the iterators.
@@ -52,23 +52,23 @@ var global_init = once(init);
// assigns State from environment variables et al
fn init() void {
if (os.getenvZ(ENV_LOGLEVEL)) |env| {
const got = mem.sliceTo(env, 0);
if (mem.eql(u8, got, "0")) {
log_level = .err;
} else if (mem.eql(u8, got, "1")) {
log_level = .warn;
} else if (mem.eql(u8, got, "2")) {
log_level = .info;
} else if (mem.eql(u8, got, "3")) {
log_level = .debug;
} else {
std.debug.print(
"warning: unrecognized {s}={s}. Expected between 0 and 3\n",
.{ ENV_LOGLEVEL, got },
);
}
}
//if (os.getenvZ(ENV_LOGLEVEL)) |env| {
// const got = mem.sliceTo(env, 0);
// if (mem.eql(u8, got, "0")) {
// log_level = .err;
// } else if (mem.eql(u8, got, "1")) {
// log_level = .warn;
// } else if (mem.eql(u8, got, "2")) {
// log_level = .info;
// } else if (mem.eql(u8, got, "3")) {
// log_level = .debug;
// } else {
// std.debug.print(
// "warning: unrecognized {s}={s}. Expected between 0 and 3\n",
// .{ ENV_LOGLEVEL, got },
// );
// }
//}
const omit_members = blk: {
if (os.getenvZ(ENV_OMIT_MEMBERS)) |env| {