Skip to content
This repository has been archived by the owner on Jan 22, 2024. It is now read-only.

File formatting: client-example/main.go #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

laikee99
Copy link

Just format client-exmaple/main.go by go-format.

… when

you don't want to change `client.config.Labels`.
add: add a new method `LogfWithLabel`, etc to submit a logline without prefix such as
`ERROR`, `INFO` etc.
@@ -82,6 +82,7 @@ func main() {
loki.Infof("source = %s, time = %s, i = %d\n", source_name, tstamp, i)
loki.Warnf("source = %s, time = %s, i = %d\n", source_name, tstamp, i)
loki.Errorf("source = %s, time = %s, i = %d\n", source_name, tstamp, i)
loki.LogfWithLabel("{source=\"new_"+source_name+"\"}", "source = %s, time = %s, i = %d\n", source_name, tstamp, i)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this line shouldn't be in this patch.

InfofWithLabel(label, format string, args ...interface{})
WarnfWithLabel(label, format string, args ...interface{})
ErrorfWithLabel(label, format string, args ...interface{})
LogfWithLabel(label, format string, args ...interface{})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

Copy link
Owner

@afiskon afiskon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch doesn't simply change the code formatting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants