From e83a808b0575f14e1aee2bb887f4c75b9411e317 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Tue, 11 Aug 2020 17:23:00 +0100 Subject: [PATCH] make log dir a variable --- runtime/local/local.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/local/local.go b/runtime/local/local.go index 214c9505..a1758106 100644 --- a/runtime/local/local.go +++ b/runtime/local/local.go @@ -20,6 +20,11 @@ import ( // defaultNamespace to use if not provided as an option const defaultNamespace = "default" +var ( + // The directory for logs to be output + LogDir = filepath.Join(os.TempDir(), "micro", "logs") +) + type localRuntime struct { sync.RWMutex // options configure runtime @@ -46,8 +51,7 @@ func NewRuntime(opts ...runtime.Option) runtime.Runtime { } // make the logs directory - path := filepath.Join(os.TempDir(), "micro", "logs") - _ = os.MkdirAll(path, 0755) + os.MkdirAll(LogDir, 0755) return &localRuntime{ options: options,