Rename Process to Instance

This commit is contained in:
2025-10-16 19:38:44 +02:00
parent 964c6345ef
commit 80ca0cbd4f
14 changed files with 110 additions and 110 deletions

View File

@@ -10,7 +10,7 @@ import (
"time"
)
type Logger struct {
type logger struct {
name string
logDir string
logFile *os.File
@@ -18,15 +18,15 @@ type Logger struct {
mu sync.RWMutex
}
func NewInstanceLogger(name string, logDir string) *Logger {
return &Logger{
func NewLogger(name string, logDir string) *logger {
return &logger{
name: name,
logDir: logDir,
}
}
// Create creates and opens the log files for stdout and stderr
func (i *Logger) Create() error {
func (i *logger) Create() error {
i.mu.Lock()
defer i.mu.Unlock()
@@ -57,7 +57,7 @@ func (i *Logger) Create() error {
}
// GetLogs retrieves the last n lines of logs from the instance
func (i *Logger) GetLogs(num_lines int) (string, error) {
func (i *logger) GetLogs(num_lines int) (string, error) {
i.mu.RLock()
defer i.mu.RUnlock()
@@ -98,7 +98,7 @@ func (i *Logger) GetLogs(num_lines int) (string, error) {
}
// closeLogFile closes the log files
func (i *Logger) Close() {
func (i *logger) Close() {
i.mu.Lock()
defer i.mu.Unlock()
@@ -111,7 +111,7 @@ func (i *Logger) Close() {
}
// readOutput reads from the given reader and writes lines to the log file
func (i *Logger) readOutput(reader io.ReadCloser) {
func (i *logger) readOutput(reader io.ReadCloser) {
defer reader.Close()
scanner := bufio.NewScanner(reader)