ssgreg / journald Goto Github PK
View Code? Open in Web Editor NEWGo implementation of systemd Journal's native API for logging
License: MIT License
Go implementation of systemd Journal's native API for logging
License: MIT License
Hi,
Is it possible to use the "journal -u test" to get only messages from "test" unit.
I tried this ( i tried adding the WithName but this doesn't seem to do anything in my case)
// Create Logger with ChannelWriter.
logger := logf.NewLogger(logf.LevelInfo, writer).WithName("test")
logger.Info("IAN got cpu info", logf.Int("count", runtime.NumCPU()))
but it didn't work.
If I look in the logs, it is there but I can't specify the unit.
Here is the example of the log
Oct 19 13:08:11 kube01 testme.go.gorun[253735]: IAN got cpu info
Another thing that I am not sure if it's possible to control, but you notice the "testme.go.gorun", is it possible to control that ?
I am using gorun with a go file.. my go file is called testme.go and obviously running the "gorun".
I was wondering if we can just replace this with something custom i.e "test"
Any help really appreciated
Thanks in advance
+ cd journald-1.0.0
+ LDFLAGS=' -X github.com/ssgreg/journald/version=1.0.0'
+ GO_TEST_FLAGS='-buildmode pie -compiler gc'
+ GO_TEST_EXT_LD_FLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
+ go-rpm-integration check -i github.com/ssgreg/journald -b /home/safarov/rpmbuild/BUILD/journald-1.0.0/_build/bin -s /home/safarov/rpmbuild/BUILD/journald-1.0.0/_build -V 1.0.0-1.fc33 -p /home/safarov/rpmbuild/BUILDROOT/golang-github-ssgreg-journald-1.0.0-1.fc33.x86_64 -g /usr/share/gocode -r '.*example.*'
Testing in: /home/safarov/rpmbuild/BUILD/journald-1.0.0/_build/src
PATH: /home/safarov/rpmbuild/BUILD/journald-1.0.0/_build/bin:/home/safarov/.local/bin:/home/safarov/bin:/home/safarov/.local/bin:/home/safarov/bin:/home/safarov/.local/bin:/home/safarov/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin
GOPATH: /home/safarov/rpmbuild/BUILD/journald-1.0.0/_build:/usr/share/gocode:/usr/share/gocode
GO111MODULE: off
command: go test -buildmode pie -compiler gc -ldflags " -X github.com/ssgreg/journald/version=1.0.0 -extldflags '-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
testing: github.com/ssgreg/journald
github.com/ssgreg/journald
--- FAIL: TestCheckSmallMessage (5.13s)
send_test.go:79:
Error Trace: send_test.go:79
Error: Received unexpected error:
exit status 1
Test: TestCheckSmallMessage
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.