Code formatting

This commit is contained in:
balandi1 2019-11-20 13:33:46 -05:00
parent ef8bd6ac1f
commit 4d15e59d4c
41 changed files with 472 additions and 475 deletions

View file

@ -1,20 +1,20 @@
// Copyright (C) 2018 spdfg
//
//
// This file is part of Elektron.
//
//
// Elektron is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
//
// Elektron is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with Elektron. If not, see <http://www.gnu.org/licenses/>.
//
//
package pcp
@ -24,12 +24,12 @@ import (
"syscall"
"time"
"github.com/spdfg/elektron/elektronLogging"
log "github.com/sirupsen/logrus"
"github.com/spdfg/elektron/elektronLogging"
elekLogT "github.com/spdfg/elektron/elektronLogging/types"
log "github.com/sirupsen/logrus"
)
func Start(quit chan struct{}, logging *bool,pcpConfigFile string) {
func Start(quit chan struct{}, logging *bool, pcpConfigFile string) {
var pcpCommand string = "pmdumptext -m -l -f '' -t 1.0 -d , -c " + pcpConfigFile
cmd := exec.Command("sh", "-c", pcpCommand)
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
@ -47,9 +47,9 @@ func Start(quit chan struct{}, logging *bool,pcpConfigFile string) {
scanner.Scan()
// Write to logfile
elektronLogging.ElektronLog.Log(elekLogT.PCP,
log.InfoLevel,
log.Fields {}, scanner.Text())
elektronLogging.ElektronLog.Log(elekLogT.PCP,
log.InfoLevel,
log.Fields{}, scanner.Text())
// Throw away first set of results
scanner.Scan()
@ -60,18 +60,18 @@ func Start(quit chan struct{}, logging *bool,pcpConfigFile string) {
text := scanner.Text()
if *logging {
elektronLogging.ElektronLog.Log(elekLogT.PCP,
log.InfoLevel,
log.Fields {}, text)
elektronLogging.ElektronLog.Log(elekLogT.PCP,
log.InfoLevel,
log.Fields{}, text)
}
seconds++
}
}(logging)
elektronLogging.ElektronLog.Log(elekLogT.GENERAL,
elektronLogging.ElektronLog.Log(elekLogT.GENERAL,
log.InfoLevel,
log.Fields {}, "PCP logging started")
log.Fields{}, "PCP logging started")
if err := cmd.Start(); err != nil {
log.Fatal(err)
@ -81,9 +81,9 @@ func Start(quit chan struct{}, logging *bool,pcpConfigFile string) {
select {
case <-quit:
elektronLogging.ElektronLog.Log(elekLogT.GENERAL,
log.InfoLevel,
log.Fields {}, "Stopping PCP logging in 5 seconds")
elektronLogging.ElektronLog.Log(elekLogT.GENERAL,
log.InfoLevel,
log.Fields{}, "Stopping PCP logging in 5 seconds")
time.Sleep(5 * time.Second)
// http://stackoverflow.com/questions/22470193/why-wont-go-kill-a-child-process-correctly