ROOTPLOIT
Server: LiteSpeed
System: Linux in-mum-web1878.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u435929562 (435929562)
PHP: 7.4.33
Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/go/pkg/mod/github.com/aws/[email protected]/private/model/api/logger.go
//go:build codegen
// +build codegen

package api

import (
	"fmt"
	"io"
	"sync"
)

var debugLogger *logger
var initDebugLoggerOnce sync.Once

// logger provides a basic logging
type logger struct {
	w io.Writer
}

// LogDebug initialize's the debug logger for the components in the api
// package to log debug lines to.
//
// Panics if called multiple times.
//
// Must be used prior to any model loading or code gen.
func LogDebug(w io.Writer) {
	var initialized bool
	initDebugLoggerOnce.Do(func() {
		debugLogger = &logger{
			w: w,
		}
		initialized = true
	})

	if !initialized && debugLogger != nil {
		panic("LogDebug called multiple times. Can only be called once")
	}
}

// Logf logs using the fmt printf pattern. Appends a new line to the end of the
// logged statement.
func (l *logger) Logf(format string, args ...interface{}) {
	if l == nil {
		return
	}
	fmt.Fprintf(l.w, format+"\n", args...)
}

// Logln logs using the fmt println pattern.
func (l *logger) Logln(args ...interface{}) {
	if l == nil {
		return
	}
	fmt.Fprintln(l.w, args...)
}