VERSION ?= $(shell git describe --always --tags --dirty)
COMMIT ?= $(shell git rev-parse HEAD)
-BUILD_STAMP ?= $(shell git log -1 --format="%ct")
+BUILD_STAMP ?= $(shell git log -1 --format='%ct')
BUILD_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
BUILD_HOST ?= $(shell hostname)
GO ?= go
-GOVPP_PKG := $(shell go list)
+GOVPP_PKG := git.fd.io/govpp.git
LDFLAGS = \
-X ${GOVPP_PKG}/version.version=$(VERSION) \
-X ${GOVPP_PKG}/version.commitHash=$(COMMIT) \
+--------------+
```
+## Prerequisites
+
+- [Go 1.13](https://golang.org/dl)
+
## Quick Start
Make sure that $GOPATH, $GOROOT, and $PATH are set. If you cloned the
debug = strings.Contains(os.Getenv("DEBUG_GOVPP"), "socketclient")
debugMsgIds = strings.Contains(os.Getenv("DEBUG_GOVPP"), "msgtable")
- logger = logrus.New()
- log = logger.WithField("logger", "govpp/socketclient")
+ log logrus.FieldLogger
)
-// init initializes global logger
+// SetLogger sets global logger.
+func SetLogger(logger logrus.FieldLogger) {
+ log = logger
+}
+
func init() {
+ logger := logrus.New()
if debug {
logger.Level = logrus.DebugLevel
- log.Debug("govpp: debug level enabled for socketclient")
+ logger.Debug("govpp: debug level enabled for socketclient")
}
+ log = logger.WithField("logger", "govpp/socketclient")
}
const socketMissing = `