mirror of
https://github.com/log-chipper/chipper.git
synced 2026-06-11 09:13:23 -05:00
feat: first init
- Simple unix daemon - Python, Go, and C client
This commit is contained in:
Executable
BIN
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
#include "../clients/c/chipper_client.h"
|
||||
|
||||
int main(void) {
|
||||
if (chipper_client_init("/tmp/chipper.sock", "myapp", "worker") != 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
chipper_client_log("info", "hello from C client, user_id=%d", 42);
|
||||
chipper_client_log("error", "something failed: %s", "oops");
|
||||
|
||||
chipper_client_close();
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package main
|
||||
|
||||
import "github.com/log-chipper/chipper"
|
||||
|
||||
func main() {
|
||||
client, err := chipper.NewClient()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer client.Close()
|
||||
|
||||
client.Log("info", "hello from go")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
from ..clients.python.chipper_client import *
|
||||
|
||||
if __name__ == "__main__":
|
||||
c: ChipperClient = ChipperClient(service="python_example", source="example")
|
||||
c.log("info", "hello from python example")
|
||||
c.log("error", "something failed")
|
||||
c.close()
|
||||
|
||||
Reference in New Issue
Block a user