diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..89480ff --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,33 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "type": "lldb", + "request": "launch", + "name": "Debug Main", + "program": "${workspaceFolder}/${workspaceFolderBasename}", + "preLaunchTask": "zig build", + "args": [], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" + }, + { + "type": "lldb", + "request": "launch", + "name": "Debug Test", + "program": "${workspaceFolder}/zig-out/test-binary", + "preLaunchTask": "build_test", + "args": [], + "cwd": "${workspaceFolder}", + "console": "integratedTerminal" + } + ], + "inputs": [ + { + "type": "promptString", + "id": "testFile", + "description": "Test file path", + "default": "src/root_tests.zig" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..649e354 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,35 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "zig build", + "type": "shell", + "command": "zig", + "args": ["build"], + "group": { + "kind": "build", + "isDefault": true + } + }, + { + "label": "build_test", + "type": "shell", + "command": "zig", + "args": [ + "test", + "${input:testFile}", + "--test-no-exec", + "-femit-bin=${workspaceFolder}/zig-out/test-binary" + ], + "group": "test" + } + ], + "inputs": [ + { + "type": "promptString", + "id": "testFile", + "description": "Test file path", + "default": "src/root_tests.zig" + } + ] +} \ No newline at end of file diff --git a/_notes.txt b/_notes.txt index 2fb2f31..3e8dcd1 100644 --- a/_notes.txt +++ b/_notes.txt @@ -393,3 +393,10 @@ Import Github MD https://gist.github.com/nikhilnayyar002/7a35e653d3d590e317c829243e73b110 + +VSCode configuration + variables + https://code.visualstudio.com/docs/editor/variables-reference + + launch.json & tasks.json + https://gist.github.com/amantuladhar/ee210628d55161ba3046b1ac9ff419a1 \ No newline at end of file diff --git a/src/syslog.zig b/src/syslog.zig index 78d88d8..6bd8775 100644 --- a/src/syslog.zig +++ b/src/syslog.zig @@ -121,7 +121,7 @@ pub const Syslog = struct { return error.NotReady; } - if(slog.filter != null){ + if (slog.filter != null) { if (@intFromEnum(svr) >= @intFromEnum(slog.filter.?)) { return; } @@ -141,7 +141,7 @@ pub const Syslog = struct { return error.NotReady; } - if(slog.filter != null){ + if (slog.filter != null) { if (@intFromEnum(svr) >= @intFromEnum(slog.filter.?)) { return; }