• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 15585238734

11 Jun 2025 12:45PM UTC coverage: 55.877%. First build
15585238734

Pull #3675

github

web-flow
Merge e33c2bc18 into b3bee3dd5
Pull Request #3675: feat: hot reload eszip bundle when function source changes

414 of 536 new or added lines in 8 files covered. (77.24%)

6280 of 11239 relevant lines covered (55.88%)

7.18 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/internal/utils/logger.go
1
package utils
2

3
import (
4
        "fmt"
5
        "io"
6
        "os"
7

8
        "github.com/spf13/viper"
9
)
10

11
// GetVerbosity returns the current verbosity level (0 = minimal, 1 = normal info, 2+ = more verbose)
12
func GetVerbosity() int {
84✔
13
        return viper.GetInt("VERBOSITY")
84✔
14
}
84✔
15

16
func GetDebugLogger() io.Writer {
37✔
17
        if viper.GetBool("DEBUG") {
52✔
18
                return os.Stderr
15✔
19
        }
15✔
20
        return io.Discard
22✔
21
}
22

23
// TODO: refactor accross all codebase for consistency
24
// Info logs an info message to stderr if the current verbosity level is >= the required level
25
// level 0: always shown (important info)
26
// level 1: normal verbosity
27
// level 2+: high verbosity
28
func Info(level int, format string, args ...interface{}) {
84✔
29
        if GetVerbosity() >= level {
84✔
NEW
30
                message := fmt.Sprintf(format, args...)
×
NEW
31
                fmt.Fprintf(os.Stderr, "%s %s\n", Blue("INFO:"), message)
×
NEW
32
        }
×
33
}
34

35
// Debug logs a debug message to the debug logger (stderr when DEBUG=true, otherwise discarded)
NEW
36
func Debug(format string, args ...interface{}) {
×
NEW
37
        message := fmt.Sprintf(format, args...)
×
NEW
38
        fmt.Fprintf(GetDebugLogger(), "%s %s\n", Aqua("DEBUG:"), message)
×
NEW
39
}
×
40

41
// Warning logs a warning message to stderr with consistent formatting and styling
42
func Warning(format string, args ...interface{}) {
2✔
43
        message := fmt.Sprintf(format, args...)
2✔
44
        fmt.Fprintf(os.Stderr, "%s %s\n", Yellow("WARNING:"), message)
2✔
45
}
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc