From 6e1af993924bc7bebe898b403962db5a6b3505d1 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 2 Oct 2021 11:23:08 +0300 Subject: Client default log dir is ~/log --- internal/source/source.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 internal/source/source.go (limited to 'internal/source') diff --git a/internal/source/source.go b/internal/source/source.go new file mode 100644 index 0000000..bf1c880 --- /dev/null +++ b/internal/source/source.go @@ -0,0 +1,19 @@ +package source + +type Source int + +const ( + Client Source = iota + Server Source = iota +) + +func (s Source) String() string { + switch s { + case Client: + return "Client" + case Server: + return "Server" + } + + panic("Unknown log source type") +} -- cgit v1.2.3 From 12c79f68bb5bda6673819d7b754820ecfe6d08ff Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 2 Oct 2021 11:54:07 +0300 Subject: reduce logging in serverless mode --- internal/source/source.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/source') diff --git a/internal/source/source.go b/internal/source/source.go index bf1c880..73dccb2 100644 --- a/internal/source/source.go +++ b/internal/source/source.go @@ -10,9 +10,9 @@ const ( func (s Source) String() string { switch s { case Client: - return "Client" + return "CLIENT" case Server: - return "Server" + return "SERVER" } panic("Unknown log source type") -- cgit v1.2.3 From f70622f307629a2542ea5eb128dea8c1043d3a40 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 5 Oct 2021 10:00:38 +0300 Subject: more on this --- internal/source/source.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'internal/source') diff --git a/internal/source/source.go b/internal/source/source.go index 73dccb2..be7aecd 100644 --- a/internal/source/source.go +++ b/internal/source/source.go @@ -3,8 +3,9 @@ package source type Source int const ( - Client Source = iota - Server Source = iota + Client Source = iota + Server Source = iota + HealthCheck Source = iota ) func (s Source) String() string { @@ -13,7 +14,9 @@ func (s Source) String() string { return "CLIENT" case Server: return "SERVER" + case HealthCheck: + return "HEALTHCHECK" } - panic("Unknown log source type") + panic("Unknown source type") } -- cgit v1.2.3 From 97747ea0f3178f7f5890512d483fdccaa82846b0 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 9 Oct 2021 21:10:29 +0300 Subject: vetting and linting and some code restyling --- internal/source/source.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'internal/source') diff --git a/internal/source/source.go b/internal/source/source.go index be7aecd..4bb0784 100644 --- a/internal/source/source.go +++ b/internal/source/source.go @@ -1,10 +1,19 @@ package source +// Source specifies the origin of either the current process (dtail is a client +// process, dserver is a server process) or the source code package (e.g. +// dserver server side code or dtail client side code). Notice that dtail client +// may also executes server code directly (e.g. via serverless mode) and that +// the dserver may also executes client code (e.g. via scheduled server side +// mapreduce queries). type Source int const ( - Client Source = iota - Server Source = iota + // Client process or source code package. + Client Source = iota + // Server process or source code package. + Server Source = iota + // HealthCheck process or client source code package. HealthCheck Source = iota ) @@ -17,6 +26,5 @@ func (s Source) String() string { case HealthCheck: return "HEALTHCHECK" } - panic("Unknown source type") } -- cgit v1.2.3