Skip to content

Commit fea1e30

Browse files
committed
remove debugging logs
1 parent 70d5815 commit fea1e30

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

server/server.go

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ type HealthResponse struct {
8383
Status string `json:"status"`
8484
Version string `json:"version"`
8585
Uptime string `json:"uptime"`
86-
S3Bucket string `json:"s3_bucket"`
8786
CacheSize string `json:"cache_size"`
8887
CacheEntries int `json:"cache_entries"`
8988
}
@@ -111,7 +110,7 @@ func getFromCache(ctx context.Context, version, path string) *CacheEntry {
111110
cacheKey := fmt.Sprintf("%s%s", version, strings.TrimPrefix(path, "/"))
112111

113112
// Log S3 access for debugging
114-
log.Printf("S3 lookup: bucket=%s, key=%s", s3Bucket, cacheKey)
113+
// log.Printf("S3 lookup: bucket=%s, key=%s", s3Bucket, cacheKey)
115114

116115
// Check cache first
117116
cacheMutex.RLock()
@@ -136,7 +135,7 @@ func getFromCache(ctx context.Context, version, path string) *CacheEntry {
136135
defer result.Body.Close()
137136
content, err := io.ReadAll(result.Body)
138137
if err == nil {
139-
log.Printf("S3 file found: %s (%d bytes)", cacheKey, len(content))
138+
// log.Printf("S3 file found: %s (%d bytes)", cacheKey, len(content))
140139
entry := &CacheEntry{
141140
Exists: true,
142141
IsFile: true,
@@ -147,10 +146,10 @@ func getFromCache(ctx context.Context, version, path string) *CacheEntry {
147146
cacheMutex.Unlock()
148147
return entry
149148
} else {
150-
log.Printf("S3 file read error for %s: %v", cacheKey, err)
149+
// log.Printf("S3 file read error for %s: %v", cacheKey, err)
151150
}
152151
} else {
153-
log.Printf("S3 file fetch error for %s: %v", cacheKey, err)
152+
// log.Printf("S3 file fetch error for %s: %v", cacheKey, err)
154153
}
155154

156155
// Not a file, try as directory
@@ -169,7 +168,7 @@ func getFromCache(ctx context.Context, version, path string) *CacheEntry {
169168

170169
if err != nil {
171170
s3ListErrors.Inc()
172-
log.Printf("S3 list error for key %s: %v", cacheKey, err)
171+
// log.Printf("S3 list error for key %s: %v", cacheKey, err)
173172
// Cache as non-existent
174173
entry := &CacheEntry{Exists: false}
175174
cacheMutex.Lock()
@@ -684,11 +683,14 @@ func buildTypeScript(code string, version string) BuildResponse {
684683

685684
if len(result.OutputFiles) == 0 {
686685
compileResults.WithLabelValues("error").Inc()
686+
// log.Printf("Build failed: No output files generated")
687687
return BuildResponse{Errors: []DiagnosticError{{Message: "No output generated"}}}
688688
}
689689

690+
code := string(result.OutputFiles[0].Contents)
691+
// log.Printf("Build successful: Generated %d bytes of code", len(code))
690692
compileResults.WithLabelValues("success").Inc()
691-
return BuildResponse{Code: string(result.OutputFiles[0].Contents)}
693+
return BuildResponse{Code: code}
692694
}
693695

694696
// Middleware for request logging
@@ -736,7 +738,6 @@ func health(w http.ResponseWriter, req *http.Request) {
736738
Status: "healthy",
737739
Version: serverVersion,
738740
Uptime: fmt.Sprintf("%v", uptime.Round(time.Second)),
739-
S3Bucket: s3Bucket,
740741
CacheSize: fmt.Sprintf("%d MB", cacheSize/(1024*1024)),
741742
CacheEntries: cacheEntries,
742743
}
@@ -750,8 +751,8 @@ func hello(w http.ResponseWriter, req *http.Request) {
750751
http.NotFound(w, req)
751752
return
752753
}
753-
fmt.Fprintf(w, "TypeScript Go Server v%s\nUptime: %v\nS3 Bucket: %s\n",
754-
serverVersion, time.Since(startTime).Round(time.Second), s3Bucket)
754+
fmt.Fprintf(w, "TypeScript Go Server v%s\nUptime: %v\n",
755+
serverVersion, time.Since(startTime).Round(time.Second))
755756
}
756757

757758
func typecheck(w http.ResponseWriter, req *http.Request) {

0 commit comments

Comments
 (0)