Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow custom element separators in sugar logger model #814

Open
chatter1986 opened this issue Apr 10, 2020 · 1 comment
Open

allow custom element separators in sugar logger model #814

chatter1986 opened this issue Apr 10, 2020 · 1 comment

Comments

@chatter1986
Copy link

By default, consoleEncoder add '\t' to separator elements, can provide customization capabilities?

func (c consoleEncoder) EncodeEntry(ent Entry, fields []Field) (*buffer.Buffer, error) {
	line := bufferpool.Get()
        
        ...

	for i := range arr.elems {
		if i > 0 {
			line.AppendByte('\t')
		}
		fmt.Fprint(line, arr.elems[i])
	}

func (c consoleEncoder) addTabIfNecessary(line *buffer.Buffer) {
	if line.Len() > 0 {
		line.AppendByte('\t')
	}
}
@prashantv
Copy link
Collaborator

There's a pending change, see #697 which aims to provide this feature, but it has some pending code review comments.

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

No branches or pull requests

2 participants