Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions internal/debug/loudpanic.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the CortexTheseus library. If not, see <http://www.gnu.org/licenses/>.

//go:build go1.6
// +build go1.6

package debug

import "runtime/debug"
Expand Down
25 changes: 0 additions & 25 deletions internal/debug/loudpanic_fallback.go

This file was deleted.

3 changes: 0 additions & 3 deletions internal/debug/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the CortexTheseus library. If not, see <http://www.gnu.org/licenses/>.

//go:build go1.5
// +build go1.5

package debug

import (
Expand Down
32 changes: 0 additions & 32 deletions internal/debug/trace_fallback.go

This file was deleted.

19 changes: 19 additions & 0 deletions log/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"reflect"
"sync"
"sync/atomic"

"github.com/go-stack/stack"
)
Expand Down Expand Up @@ -354,3 +355,21 @@ func (m muster) FileHandler(path string, fmtr Format) Handler {
func (m muster) NetHandler(network, addr string, fmtr Format) Handler {
return must(NetHandler(network, addr, fmtr))
}

// swapHandler wraps another handler that may be swapped out
// dynamically at runtime in a thread-safe fashion.
type swapHandler struct {
handler atomic.Value
}

func (h *swapHandler) Log(r *Record) error {
return (*h.handler.Load().(*Handler)).Log(r)
}

func (h *swapHandler) Swap(newHandler Handler) {
h.handler.Store(&newHandler)
}

func (h *swapHandler) Get() Handler {
return *h.handler.Load().(*Handler)
}
27 changes: 0 additions & 27 deletions log/handler_go13.go

This file was deleted.

24 changes: 0 additions & 24 deletions log/handler_go14.go

This file was deleted.