* chore: refactor to use structured logging
- change fmt.sprintf method used in the logger to appropriate mlog
method
* implement suggested changes by removing added line during merge conflict
* chore: refactor to use structured logging
- remove the unsed fmt package
- convert the fmt.sprintt to the structured logging
* implement requested changes from iomodo
* implement feedback from willfrog
* [MM-19007] Migrate tests from "app/job_test.go" to use testify
- Use 'require' and 'assert' methods instead of 't.Fatal'
* [MM-19007] Change 'assert' to 'require' to keep 't.Fatal' behavior
* MM-18540 - Demo plugin crashes on server shutdown
* MM-18540 - Removed unncessary lock statements
* Added comments, logging a warning if PluginsEnv is updated while shutting down plugins
* Don't clean up PluginsEnv if another Env is detected
* Changing warn to debug
* Revert "Changing warn to debug"
This reverts commit 46f20ab21eeabb01d07f53e02d850cd6d9b2b837.
* Convert app/user_test.go t.Fatal calls into assert/require calls
* arrange expected and actual arguments as per semantics
* arrange expected and actual arguments as per go semantics
* fix for notEqual
* diagnostics_test.go: fix spacing
* diagnostics_test.go: explicitly assert payload
This fails, since the package is currently receiving struct pointers and won't set the MessageId or Timestamp on the corresponding Message.
* MM-18115: fix segment v3 usage
In v5.14, we updated [github.com/segmentio/analytics-go](https://github.com/segmentio/analytics-go) to v3 as part of https://mattermost.atlassian.net/browse/MM-12389. As noted in the [migration guide](https://segment.com/docs/sources/server/go/#migrating-from-v2), the API subtly changed to expect a struct value and not a struct pointer:
```go
// in v2, you would call the `Track` method with a `Track` struct.
client.Track(&track)
// in v3, you would call the `Enqueue` method with a `Track` struct.
// Note that a pointer is not used here.
client.Enqueue(track)
```
Unfortunately, we kept passing a pointer, and the package didn't complain since it only required an interface -- which the pointer to these structs still implemented. Internally, it only checked for the value types, and failed to annotate our payloads with the requisite metadata. Upstream, segment.io accepted the payload, but then discarded it silently.
This has since been reported and fixed in https://github.com/segmentio/analytics-go/pull/146, but isn't yet part of a tagged release of the package.
Fix our code to pass struct values instead.
Fixes: MM-18115
* Convert app/notification_email_test.go t.Fatal calls into assert/require calls
* changes as per review
* using require.Regexp instead of require.True