summaryrefslogtreecommitdiffstats
path: root/widgets/proc_other.go
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/proc_other.go')
-rw-r--r--widgets/proc_other.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/widgets/proc_other.go b/widgets/proc_other.go
index b761431..a485c4f 100644
--- a/widgets/proc_other.go
+++ b/widgets/proc_other.go
@@ -23,7 +23,7 @@ func getProcs() ([]Proc, error) {
keywords := fmt.Sprintf("pid=%s,comm=%s,pcpu=%s,pmem=%s,args", ten, fifty, five, five)
output, err := exec.Command("ps", "-caxo", keywords).Output()
if err != nil {
- return nil, fmt.Errorf("failed to execute 'ps' command: %v", err)
+ return nil, fmt.Errorf(tr.Value("widget.proc.err.ps", err.Error()))
}
// converts to []string and removes the header
@@ -33,15 +33,15 @@ func getProcs() ([]Proc, error) {
for _, line := range linesOfProcStrings {
pid, err := strconv.Atoi(strings.TrimSpace(line[0:10]))
if err != nil {
- log.Printf("failed to convert first field to int: %v. split: %v", err, line)
+ log.Println(tr.Value("widget.proc.err.pidconv", err.Error(), line))
}
cpu, err := strconv.ParseFloat(utils.ConvertLocalizedString(strings.TrimSpace(line[63:68])), 64)
if err != nil {
- log.Printf("failed to convert third field to float: %v. split: %v", err, line)
+ log.Println(tr.Value("widget.proc.err.cpuconv", err.Error(), line))
}
mem, err := strconv.ParseFloat(utils.ConvertLocalizedString(strings.TrimSpace(line[69:74])), 64)
if err != nil {
- log.Printf("failed to convert fourth field to float: %v. split: %v", err, line)
+ log.Println(tr.Value("widget.proc.err.memconv", err.Error(), line))
}
proc := Proc{
Pid: pid,