func Wrap(err error, args ...interface{}) Error {
	if err == nil {
		return nil
	}
	var trace Error
	if traceErr, ok := err.(Error); ok {
		trace = traceErr
	} else {
		trace = newTrace(err, 2)
	}
	if len(args) > 0 {
		trace = trace.AddUserMessage(args[0], args[1:]...)
	}
	return trace
}
Wrap takes the original error and wraps it into the Trace struct
memorizing the context of the error.
package trace
import (
	"bytes"
	"encoding/json"
	"fmt"
	"html/template"
	"strings"
	"sync/atomic"
	"github.com/gravitational/trace/internal"
	"golang.org/x/net/context"
)
var debug int32
func SetDebug(enabled bool) {
	if enabled {
		atomic.StoreInt32(&debug, 1)
	} else {
		atomic.StoreInt32(&debug, 0)
	}
}
func IsDebug() bool {
	return atomic.LoadInt32(&debug) == 1
}