Skip to content

代码当中 kafkaQueue 结构体的 Stop 函数为啥把 logx 也 Close 了,全局的 logx 也 Close 了,把之前设置好的 logx 也变成输出控制台了 #86

@pwm1992

Description

@pwm1992

kq/queue.go
line 205

func (q *kafkaQueue) Stop() {
	q.consumer.Close()
	logx.Close()
}

logx.Close() will clear the global logs writer, before that my program turn the writer to file neutralize.

// Close closes the logging.
func Close() error {
	if w := writer.Swap(nil); w != nil {
		return w.(io.Closer).Close()
	}

	return nil
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions