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

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

Open
laikee99 wants to merge 4 commits into
afiskon:masterfrom
laikee99:format_example
Open

File formatting: client-example/main.go#7
laikee99 wants to merge 4 commits into
afiskon:masterfrom
laikee99:format_example

Conversation

@laikee99

Copy link
Copy Markdown

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

laikee99 added 4 commits June 11, 2022 15:58
… 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.
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
Copy Markdown
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.

Comment thread promtail/common.go
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
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Ditto.

@afiskon afiskon left a comment

Copy link
Copy Markdown
Owner

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.

2 participants