File: export_test.go

package info (click to toggle)
golang-github-juju-loggo 2.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 256 kB
  • sloc: makefile: 10
file content (20 lines) | stat: -rw-r--r-- 506 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright 2016 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.

package loggo

// WriterNames returns the names of the context's writers for testing purposes.
func (c *Context) WriterNames() []string {
	c.writersMutex.Lock()
	defer c.writersMutex.Unlock()
	var result []string
	for name := range c.writers {
		result = append(result, name)
	}
	return result
}

func ResetDefaultContext() {
	ResetLogging()
	_ = DefaultContext().AddWriter(DefaultWriterName, defaultWriter())
}