master > master: code go - vereinfachte logging
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
|
||||
func Version() {
|
||||
logging.SetForce(true)
|
||||
logging.LogPlain(setup.Version())
|
||||
logging.Plain(setup.Version())
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------- *
|
||||
@@ -26,11 +26,9 @@ func Version() {
|
||||
func Help() {
|
||||
logging.SetForce(true)
|
||||
cli.ParseCli([]string{}) // <- generiere leere Instanz für Parser, um voll Hilfsanleitug zu zeigen
|
||||
logging.LogPlain(
|
||||
"",
|
||||
setup.Logo(),
|
||||
// setup.Help(),
|
||||
cli.Parser.Usage(nil),
|
||||
"",
|
||||
)
|
||||
logging.Plain("")
|
||||
logging.Plain(setup.Logo())
|
||||
// logging.Plain(setup.Help())
|
||||
logging.Plain(cli.Parser.Usage(nil))
|
||||
logging.Plain("")
|
||||
}
|
||||
|
||||
@@ -26,9 +26,9 @@ import (
|
||||
|
||||
// Startet App im interaktiven Modus
|
||||
func RunInteractive() error {
|
||||
logging.LogPlain(setup.Logo())
|
||||
logging.Plain(setup.Logo())
|
||||
_, err := menuMain.ShowMenu()
|
||||
logging.LogInfo("Programm terminiert.")
|
||||
logging.Info("Programm terminiert.")
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ func RunNonInteractive(path string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
logging.LogPlain(setup.Logo())
|
||||
logging.Plain(setup.Logo())
|
||||
|
||||
// Fälle extrahieren
|
||||
cases := []types.UserConfigCase{}
|
||||
@@ -157,7 +157,7 @@ func RunNonInteractive(path string) error {
|
||||
}
|
||||
}
|
||||
if err_case != nil {
|
||||
logging.LogError(err_case)
|
||||
logging.Error(err_case)
|
||||
}
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
|
||||
@@ -35,7 +35,7 @@ func actionAlgorithmSearchBinary() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_binary.FancyBinarySearch(input_L, input_x)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -56,7 +56,7 @@ func actionAlgorithmSearchInterpolation() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_interpol.FancyInterpolationSearch(input_L, input_x, 0, len(input_L)-1)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -76,7 +76,7 @@ func actionAlgorithmSearchIthElement() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_ith_element.FancyFindIthSmallest(input_L, input_i)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -96,7 +96,7 @@ func actionAlgorithmSearchIthElementDc() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_ith_element.FancyFindIthSmallestDC(input_L, input_i)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -124,7 +124,7 @@ func actionAlgorithmSearchJump() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_jump.FancyJumpSearchLinear(input_L, input_x, input_m)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -146,7 +146,7 @@ func actionAlgorithmSearchJumpExp() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_jump.FancyJumpSearchExponentiell(input_L, input_x)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -162,7 +162,7 @@ func actionAlgorithmSearchPoison() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_poison.FancyFindPoison(input_L)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -178,7 +178,7 @@ func actionAlgorithmSearchPoisonFast() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_poison.FancyFindPoisonFast(input_L)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -196,7 +196,7 @@ func actionAlgorithmSearchSequential() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, err = algorithm_search_sequential.FancySequentialSearch(input_L, input_x)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -210,7 +210,7 @@ func actionAlgorithmSumMaxsub() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, _, _, err = algorithm_sum_maxsubsum.FancyMaxSubSum(input_L)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
@@ -224,7 +224,7 @@ func actionAlgorithmSumMaxsubDc() (bool, error) {
|
||||
setup.DisplayStartOfCaseBlank()
|
||||
_, _, _, err = algorithm_sum_maxsubsum.FancyMaxSubSumDC(input_L)
|
||||
if err != nil {
|
||||
logging.LogError(err)
|
||||
logging.Error(err)
|
||||
}
|
||||
setup.DisplayEndOfCase()
|
||||
return cancel, nil
|
||||
|
||||
@@ -14,12 +14,10 @@ import (
|
||||
* ---------------------------------------------------------------- */
|
||||
|
||||
func actionShowVersion() (bool, error) {
|
||||
logging.LogPlain(
|
||||
"",
|
||||
setup.Logo(),
|
||||
setup.Version(),
|
||||
"",
|
||||
)
|
||||
logging.Plain("")
|
||||
logging.Plain(setup.Logo())
|
||||
logging.Plain("Version: \033[1m%s\033[0m", setup.Version())
|
||||
logging.Plain("")
|
||||
return false, nil
|
||||
}
|
||||
|
||||
@@ -5,8 +5,6 @@ package run
|
||||
* ---------------------------------------------------------------- */
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"ads/internal/core/logging"
|
||||
"ads/internal/setup"
|
||||
)
|
||||
@@ -21,17 +19,17 @@ func actionShowSettings() (bool, error) {
|
||||
if logging.GetAnsiMode() {
|
||||
state = "ein"
|
||||
}
|
||||
logging.LogInfo(fmt.Sprintf("Farbenmodus: %s", state))
|
||||
logging.Info("Farbenmodus: %s", state)
|
||||
state = "aus"
|
||||
if logging.GetDebugMode() {
|
||||
state = "ein"
|
||||
}
|
||||
logging.LogInfo(fmt.Sprintf("Debugmodus: %s", state))
|
||||
logging.Info("Debugmodus: %s", state)
|
||||
state = "aus"
|
||||
if setup.AppConfigPerformChecks() {
|
||||
state = "ein"
|
||||
}
|
||||
logging.LogInfo(fmt.Sprintf("Pre/Postchecking: %s", state))
|
||||
logging.Info("Pre/Postchecking: %s", state)
|
||||
return false, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user