Code Refactoring

Modified comments. Organized imports.
This commit is contained in:
balandi1 2019-11-26 14:24:20 -05:00
parent 2fa3bebaa6
commit 0c0361e209
24 changed files with 114 additions and 105 deletions

View file

@ -1,11 +1,12 @@
package elektronLogging
import (
log "github.com/sirupsen/logrus"
"os"
"strconv"
"strings"
"time"
log "github.com/sirupsen/logrus"
)
type logDirectory struct {
@ -19,8 +20,7 @@ func (logD *logDirectory) getDirName() string {
func (logD *logDirectory) createLogDir(prefix string, startTime time.Time) {
if logD.name == "" {
// Creating directory to store all logs for this run
// directory name format - 2019-November-21_14-33-0
// Creating directory to store all logs for this run. Directory name format - 2019-November-21_14-33-0.
logDirName := strings.Join([]string{"./", prefix, strconv.Itoa(startTime.Year())}, "")
logDirName = strings.Join([]string{logDirName, startTime.Month().String(), strconv.Itoa(startTime.Day())}, "-")
logDirName = strings.Join([]string{logDirName, strconv.Itoa(startTime.Hour())}, "_")