func TestDisableTag(t *testing.T) { log, buf := createLogger() log.Enable("footag") log.Print("footag", "foo") compare(t, buf, "foo\n") log.Disable("footag") log.Print("footag", "foo") compare(t, buf, "") }
func TestMultitag(t *testing.T) { log, buf := createLogger() log.Enable("footag") log.Enable("bartag") log.Print("notag, other", "foo") compare(t, buf, "") log.Print("notag, footag", "foo") compare(t, buf, "foo\n") log.Print("footag, bartag", "foo") compare(t, buf, "foo\n") log.Print("footag,bartag", "foo") compare(t, buf, "foo\n") log.Disable("footag,bartag") log.Print("footag", "foo") compare(t, buf, "") log.Print("bartag", "foo") compare(t, buf, "") }