diff --git a/README.md b/README.md index 04a627c..9407642 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,14 @@ > **News & Info** > +>### [Discussion forums](https://github.com/CLIP-HPC/goslmailer/discussions) have been enabled for this project, feel free to share your thoughts and ideas there. +> +> v2.7.1 +> +> * In v2.7.0 dumping of configuration at goslmailer/gobler startup was removed. +> * Now it can be selectively enabled with `debugconfig: true` parameter in [config file](./cmd/goslmailer/goslmailer.conf.annotated_example) +> +> > v2.7.0 > > * [slack connector](#slack-connector) diff --git a/VERSION b/VERSION index 873ca0f..9b4b5fb 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v2.7.0 +v2.7.1 diff --git a/cmd/gobler/gobler.go b/cmd/gobler/gobler.go index ddd5e6a..5d3b248 100644 --- a/cmd/gobler/gobler.go +++ b/cmd/gobler/gobler.go @@ -59,7 +59,7 @@ func main() { version.DumpVersion(l) - // cfg.DumpConfig(l) + cfg.DumpConfig(l) // populate map with configured referenced connectors err = connectors.ConMap.PopulateConnectors(cfg, l) diff --git a/cmd/goslmailer/goslmailer.conf.annotated_example b/cmd/goslmailer/goslmailer.conf.annotated_example index e33ff15..08781b2 100644 --- a/cmd/goslmailer/goslmailer.conf.annotated_example +++ b/cmd/goslmailer/goslmailer.conf.annotated_example @@ -1,5 +1,6 @@ { # don't forget to remove the '#' comments if using this template "logfile": "/tmp/goslmailer.log", # if specified; append logs to this file; else; dump to stderr + "debugconfig": true, # if specified and true ; goslmailer and gobler will dump configuration to log; else; they won't "binpaths": { # paths to slurm binaries (optional, will default to these if not specified) "sacct":"/usr/bin/sacct", "sstat":"/usr/bin/sstat" diff --git a/cmd/goslmailer/goslmailer.go b/cmd/goslmailer/goslmailer.go index a7ba4d4..b55e949 100644 --- a/cmd/goslmailer/goslmailer.go +++ b/cmd/goslmailer/goslmailer.go @@ -9,8 +9,8 @@ import ( _ "github.com/CLIP-HPC/goslmailer/connectors/matrix" _ "github.com/CLIP-HPC/goslmailer/connectors/mattermost" _ "github.com/CLIP-HPC/goslmailer/connectors/msteams" - _ "github.com/CLIP-HPC/goslmailer/connectors/telegram" _ "github.com/CLIP-HPC/goslmailer/connectors/slack" + _ "github.com/CLIP-HPC/goslmailer/connectors/telegram" "github.com/CLIP-HPC/goslmailer/internal/config" "github.com/CLIP-HPC/goslmailer/internal/connectors" "github.com/CLIP-HPC/goslmailer/internal/logger" @@ -51,7 +51,7 @@ func main() { version.DumpVersion(l) - // cfg.DumpConfig(l) + cfg.DumpConfig(l) // get '-s "subject" userid' command line parameters with which we're called ic.getCMDLine() diff --git a/cmd/goslmailer/goslmailer.toml.annotated_example b/cmd/goslmailer/goslmailer.toml.annotated_example index d631529..a03d853 100644 --- a/cmd/goslmailer/goslmailer.toml.annotated_example +++ b/cmd/goslmailer/goslmailer.toml.annotated_example @@ -5,6 +5,9 @@ # if specified; append logs to this file; else; dump to stderr logfile = "/tmp/goslmailer.log" +# if specified and true ; goslmailer and gobler will dump configuration to log; else; they won't +debugconfig = true + # default connector to be used for message delivery for receivers without full 'connector:user' specification defaultconnector = "msteams" diff --git a/internal/config/config.go b/internal/config/config.go index f4505ea..9ce06f6 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -15,6 +15,7 @@ import ( ) type ConfigContainer struct { + DebugConfig bool `json:"debugconfig"` Logfile string `json:"logfile"` Binpaths map[string]string `json:"binpaths"` DefaultConnector string `json:"defaultconnector"` @@ -73,8 +74,10 @@ func (cc *ConfigContainer) testNsetBinPaths() error { } func (cc *ConfigContainer) DumpConfig(l *log.Logger) { - l.Println("DUMP CONFIG:") - l.Printf("CONFIGURATION: %#v\n", cc) - l.Printf("CONFIGURATION logfile: %s\n", cc.Logfile) - l.Println("--------------------------------------------------------------------------------") + if cc.DebugConfig { + l.Printf("DUMP CONFIG:\n") + l.Printf("CONFIGURATION: %#v\n", cc) + l.Printf("CONFIGURATION logfile: %s\n", cc.Logfile) + l.Printf("--------------------------------------------------------------------------------\n") + } } diff --git a/test_e2e/cases/test_01/conf/goslmailer.conf b/test_e2e/cases/test_01/conf/goslmailer.conf index fc53e4c..5bd19a1 100755 --- a/test_e2e/cases/test_01/conf/goslmailer.conf +++ b/test_e2e/cases/test_01/conf/goslmailer.conf @@ -1,4 +1,5 @@ { + "debugconfig":true, "logfile": "", "defaultconnector": "msteams", "binpaths": { diff --git a/test_e2e/run.yaml b/test_e2e/run.yaml index fc83556..6778f77 100644 --- a/test_e2e/run.yaml +++ b/test_e2e/run.yaml @@ -5,7 +5,7 @@ init: pipeline: loop_over_tests: - range: 01..06 + range: 00..06 subPath: cases/test_${index} template: