summaryrefslogtreecommitdiffstats
path: root/widgets/proc_other.go
diff options
context:
space:
mode:
authorSean E. Russell <ser@ser1.net>2020-11-23 14:58:32 -0600
committerSean E. Russell <ser@ser1.net>2020-11-23 14:58:32 -0600
commitdaf5916fde35c7ae2a69fc45a32f9c684d88fe2b (patch)
tree2090650c190b4a517d6d1f4da8fde1cb3b2c2563 /widgets/proc_other.go
parent72cde0545887f98e58423c1495327276daa202b5 (diff)
parentedf0c2a3a8edd43a685ef91c2e3f9f3ea7d5bc23 (diff)
Resolves merge conflicts
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,