Update logging info: add timestamp, refine wording

This commit is contained in:
Ray Zhou 2020-06-01 14:29:21 +08:00
parent 272b93413f
commit e64abdc72b
4 changed files with 10 additions and 9 deletions

View File

@ -70,13 +70,13 @@ func PrecheckConfirm(mgr *manager.Manager) {
table.OutputA(results)
reader := bufio.NewReader(os.Stdin)
fmt.Println("")
fmt.Println("This is a simple check of your machines.")
fmt.Println("Before installation, you should ensure that your machines meet all requirements.")
fmt.Println("This is a simple check of your environment.")
fmt.Println("Before installation, you should ensure that your machines meet all requirements specified at")
fmt.Println("https://github.com/kubesphere/kubekey#requirements-and-recommendations")
fmt.Println("")
Loop:
for {
fmt.Printf("Whether to continue this installation? [yes/no]: ")
fmt.Printf("Continue this installation? [yes/no]: ")
input, err := reader.ReadString('\n')
if err != nil {
mgr.Logger.Fatal(err)

View File

@ -58,7 +58,8 @@ func ExecTasks(mgr *manager.Manager) error {
}
}
fmt.Printf("\n\033[1;36;40m%s\033[0m\n", "Successful.")
mgr.Logger.Infoln("Successful.")
return nil
}
@ -123,7 +124,7 @@ func deleteFiles(mgr *manager.Manager) error {
func Confirm(reader *bufio.Reader) (string, error) {
for {
fmt.Printf("Are you sure you want to delete this cluster? [yes/no]: ")
fmt.Printf("Are you sure to delete this cluster? [yes/no]: ")
input, err := reader.ReadString('\n')
if err != nil {
return "", err

View File

@ -17,7 +17,6 @@ limitations under the License.
package install
import (
"fmt"
"github.com/kubesphere/kubekey/pkg/cluster/etcd"
"github.com/kubesphere/kubekey/pkg/cluster/kubernetes"
"github.com/kubesphere/kubekey/pkg/cluster/preinstall"
@ -69,7 +68,8 @@ func ExecTasks(mgr *manager.Manager) error {
}
}
fmt.Printf("\n\033[1;36;40m%s\033[0m\n", "Successful.")
mgr.Logger.Infoln("Congradulations! Installation is successful.")
return nil
}

View File

@ -17,7 +17,6 @@ limitations under the License.
package scale
import (
"fmt"
"github.com/kubesphere/kubekey/pkg/cluster/kubernetes"
"github.com/kubesphere/kubekey/pkg/cluster/preinstall"
"github.com/kubesphere/kubekey/pkg/container-engine/docker"
@ -41,6 +40,7 @@ func ExecTasks(mgr *manager.Manager) error {
}
}
fmt.Printf("\n\033[1;36;40m%s\033[0m\n", "Successful.")
mgr.Logger.Infoln("Cluster scaling is successful.")
return nil
}