...

Source file src/github.com/dsoprea/go-logging/v2/console_adapter_test.go

Documentation: github.com/dsoprea/go-logging/v2

     1  package log
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestConsole(t *testing.T) {
     8  	ecp := NewEnvironmentConfigurationProvider()
     9  	LoadConfiguration(ecp)
    10  
    11  	ClearAdapters()
    12  
    13  	cla := NewConsoleLogAdapter()
    14  	AddAdapter("console", cla)
    15  
    16  	an := GetDefaultAdapterName()
    17  	if an != "console" {
    18  		t.Error("Console adapter was not properly registered.")
    19  	}
    20  
    21  	l := NewLoggerWithAdapterName("consoleTest", "console")
    22  	l.Debugf(nil, "")
    23  
    24  	if l.Adapter() == nil {
    25  		t.Error("Adapter wasn't initialized correctly.")
    26  	}
    27  }
    28  

View as plain text