Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use logger util for sphinx-tribes/handlers #2264

Closed
Tracked by #2168
kevkevinpal opened this issue Dec 22, 2024 · 3 comments · Fixed by #2268
Closed
Tracked by #2168

Use logger util for sphinx-tribes/handlers #2264

kevkevinpal opened this issue Dec 22, 2024 · 3 comments · Fixed by #2268
Assignees

Comments

@kevkevinpal
Copy link
Contributor

kevkevinpal commented Dec 22, 2024

Description

We want to replace in sphinx-tribes/handlers where we use fmt.Print{f,ln}

grep -nri "fmt\.Print" ./handlers/
./handlers/auth.go:66:          fmt.Println("ReadAll Error", err)
./handlers/auth.go:75:          fmt.Println("Could not unmarshal connection code body")
./handlers/auth.go:113:         fmt.Println("[auth] => ERR create connection code", err)
./handlers/auth.go:152:         fmt.Println("Could not get connection code")
./handlers/auth.go:205:         fmt.Println("[auth] Error signing signature")
./handlers/auth.go:224:                 fmt.Println("[auth] error creating LNAUTH JWT")
./handlers/auth.go:248:                 fmt.Println("[auth] Socket Error", err)
./handlers/auth.go:268:         fmt.Println("[auth] Failed to parse JWT")
./handlers/auth.go:283:                 fmt.Println("[auth] error creating  refresh JWT")
./handlers/bots.go:39:          fmt.Println(err)
./handlers/bots.go:53:          fmt.Println(err)
./handlers/bots.go:73:          fmt.Println("=> ERR createOrEditBot", err)
./handlers/bots.go:130: fmt.Println("uuid: ", uuid)
./handlers/bots.go:139:         fmt.Println(err)
./handlers/bounties.go:57:              fmt.Println(err)
./handlers/bounties.go:94:              fmt.Println("peep: ", indexPeep)
./handlers/bounties.go:98:                      fmt.Println("Wanted not there")
./handlers/bounties.go:104:                     fmt.Println("looping bounties: ", index)
./handlers/bounties.go:159:                             fmt.Println(reflect.TypeOf(CreatedInt64))
./handlers/bounties.go:160:                             fmt.Println("Timestamp:", CreatedInt64)
./handlers/bounties.go:240:                     fmt.Println("Bounty about to be added ")
./handlers/bounty.go:64:                fmt.Println("[bounty] Error", err)
./handlers/bounty.go:76:                fmt.Println("[bounty] Error", err)
./handlers/bounty.go:87:                fmt.Println("[bounty] Error", err)
./handlers/bounty.go:98:                fmt.Println("[bounty] Error", err)
./handlers/bounty.go:109:               fmt.Println("[bounty] Error", err)
./handlers/bounty.go:135:               fmt.Println("[bounty] Error", err)
./handlers/bounty.go:167:               fmt.Println("[bounty] Error", err)
./handlers/bounty.go:179:               fmt.Println("[bounty] Error", err)
./handlers/bounty.go:196:               fmt.Println("[bounty read]", err)
./handlers/bounty.go:203:               fmt.Println("[bounty]", err)
./handlers/bounty.go:263:                       fmt.Println("[bounty]", msg)
./handlers/bounty.go:276:                                       fmt.Println("[bounty]", msg)
./handlers/bounty.go:283:                               fmt.Println("[bounty]", msg)
./handlers/bounty.go:307:               fmt.Println("[bounty]", err)
./handlers/bounty.go:321:               fmt.Println("[bounty] no pubkey from auth")
./handlers/bounty.go:330:               fmt.Println("[bounty] no pubkey from route")
./handlers/bounty.go:335:               fmt.Println("[bounty] no created timestamp from route")
./handlers/bounty.go:344:               fmt.Println("[bounty] failed to delete bounty", err.Error())
./handlers/bounty.go:351:               fmt.Println("[bounty] failed to delete bounty")
./handlers/bounty.go:359:               fmt.Println("[bounty] failed to delete bounty", err.Error())
./handlers/bounty.go:536:               fmt.Println("[bounty] could not parse id")
./handlers/bounty.go:543:               fmt.Println("[bounty] no pubkey from auth")
./handlers/bounty.go:601:               fmt.Println("[read body]", err)
./handlers/bounty.go:609:               fmt.Println("[bounty]", err)
./handlers/bounty.go:626:               fmt.Println("IS V2 PAYMENT ====")
./handlers/bounty.go:684:                               fmt.Println("[Unmarshal failed]", err)
./handlers/bounty.go:829:                       fmt.Println("[read body]", err)
./handlers/bounty.go:845:                               fmt.Println("[Unmarshal]", err)
./handlers/bounty.go:903:               fmt.Println("[bounty] could not parse id")
./handlers/bounty.go:909:               fmt.Println("[bounty] no pubkey from auth")
./handlers/bounty.go:946:               fmt.Println("[bounty] could not parse id")
./handlers/bounty.go:952:               fmt.Println("[bounty] no pubkey from auth")
./handlers/bounty.go:1058:              fmt.Println("[bounty] no pubkey from auth")
./handlers/bounty.go:1450:              fmt.Println("[bounty] no pubkey from auth")
./handlers/bounty_test.go:238:                  fmt.Println("Could not marshal json data")
./handlers/bounty_test.go:1245:                 fmt.Println("upgrade:", err)
./handlers/channel.go:32:               fmt.Println(err)
./handlers/channel.go:38:               fmt.Println("id is 0")
./handlers/channel.go:46:               fmt.Println("existing id is 0")
./handlers/channel.go:51:               fmt.Println("keys dont match")
./handlers/channel.go:73:               fmt.Println(err)
./handlers/channel.go:81:               fmt.Println(err)
./handlers/channel.go:89:                       fmt.Println("Channel name already in use")
./handlers/channel.go:98:               fmt.Println(err)
./handlers/features.go:60:              fmt.Println("no pubkey from auth")
./handlers/features.go:71:              fmt.Println(err)
./handlers/features.go:115:             fmt.Println("no pubkey from auth")
./handlers/features.go:137:             fmt.Println("no pubkey from auth")
./handlers/features.go:153:             fmt.Println("no pubkey from auth")
./handlers/features.go:169:             fmt.Println("no pubkey from auth")
./handlers/features.go:243:             fmt.Println("no pubkey from auth")
./handlers/features.go:292:             fmt.Println("no pubkey from auth")
./handlers/features.go:308:             fmt.Println("no pubkey from auth")
./handlers/features.go:330:             fmt.Println("no pubkey from auth")
./handlers/features.go:353:             fmt.Println("no pubkey from auth")
./handlers/features.go:394:             fmt.Println("no pubkey from auth")
./handlers/features.go:417:             fmt.Println("no pubkey from auth")
./handlers/features.go:435:             fmt.Println("no pubkey from auth")
./handlers/features.go:461:             fmt.Println("no pubkey from auth")
./handlers/features.go:485:             fmt.Println("no pubkey from auth")
./handlers/features.go:558:             fmt.Println("[StoriesSend] JSON Unmarshal error:", err)
./handlers/features.go:617:             fmt.Println("no pubkey from auth")
./handlers/features.go:632:             fmt.Println("[BriefSend] JSON Unmarshal error:", err)
./handlers/feed.go:61:          fmt.Println("[feed] ", err)
./handlers/feed.go:97:          fmt.Println("[feed] Youtube Download Error: Stakwork key not found")
./handlers/feed.go:131:                 fmt.Println("[feed] Youtube error: Unable to parse message into byte buffer", err)
./handlers/feed.go:143:                 fmt.Println("[feed] Youtube Download Request Error ===", err)
./handlers/feed.go:148:                 fmt.Println("[feed] Youtube Download Request Error ==", err)
./handlers/feed.go:150:         fmt.Println("[feed] Youtube Download Succces ==", string(res))
./handlers/feed.go:169:         fmt.Println("[feed]", err)
./handlers/feed.go:269:         fmt.Println("[feed] GET error:", err)
./handlers/feed.go:278:         fmt.Println("[feed] json unmarshall error", err)
./handlers/feed.go:311:         fmt.Println("[feed] GET error:", err)
./handlers/feed.go:320:         fmt.Println("[feed] json unmarshall error", err)
./handlers/feed.go:345:         fmt.Println("[feed] GET error:", err)
./handlers/feed.go:354:         fmt.Println("[feed] json unmarshall error", err)
./handlers/github.go:31:                fmt.Println("Github error: ", err.Error())
./handlers/meme.go:26:          fmt.Println("no pubkey from auth")
./handlers/meme.go:64:          fmt.Println(msg, mErr)
./handlers/meme.go:76:          fmt.Println(msg)
./handlers/meme.go:207:         fmt.Println("meme request Error ===", err)
./handlers/meme.go:237:         fmt.Println("The directory named", dirName, "does not exist")
./handlers/metrics.go:40:               fmt.Println("no pubkey from auth")
./handlers/metrics.go:67:               fmt.Println("no pubkey from auth")
./handlers/metrics.go:94:               fmt.Println("no pubkey from auth")
./handlers/metrics.go:130:              fmt.Println("no pubkey from auth")
./handlers/metrics.go:166:              fmt.Println("Redis client is not initialized or there is an error with Redis")
./handlers/metrics.go:203:              fmt.Println("Redis client is not initialized or there is an error with Redis")
./handlers/metrics.go:215:              fmt.Println("no pubkey from auth")
./handlers/metrics.go:243:              fmt.Println("no pubkey from auth")
./handlers/metrics.go:269:              fmt.Println("no pubkey from auth")
./handlers/metrics.go:295:              fmt.Println("no pubkey from auth")
./handlers/metrics.go:321:                      fmt.Println("Error uploading csv ===", err)
./handlers/metrics.go:336:              fmt.Println("no pubkey from auth")
./handlers/metrics.go:460:              fmt.Println("Presigned Error", err)
./handlers/metrics.go:465:              fmt.Println("Posting presign s3 error:", err)
./handlers/metrics.go:472:              fmt.Println("Error occured while posting presigned URL", err)
./handlers/people.go:161:                       fmt.Println("cant edit someone else")
./handlers/people.go:203:               fmt.Println(err)
./handlers/people.go:216:                       fmt.Println("cant edit non existing")
./handlers/people.go:226:                       fmt.Println("cant edit someone else")
./handlers/people.go:258:               fmt.Println("Cannot generate jwt token")
./handlers/people.go:288:               fmt.Println("Unable to convert created to int64")
./handlers/people.go:293:               fmt.Println("Insufficient details to delete ticket")
./handlers/people.go:298:               fmt.Println("no pubkey from auth")
./handlers/people.go:304:               fmt.Println("Could not fetch admin details from db")
./handlers/people.go:308:               fmt.Println("Only admin is allowed to delete tickets")
./handlers/people.go:315:               fmt.Println("Could not fetch person from db")
./handlers/people.go:322:               fmt.Println("No tickets found for person")
./handlers/people.go:344:               fmt.Println("Ticket to delete not found")
./handlers/people.go:384:                                               // fmt.Println("Twitter err", err)
./handlers/people.go:528:               fmt.Println("==> error: ", err)
./handlers/people.go:536:       fmt.Println()
./handlers/people.go:549:               fmt.Println(err)
./handlers/people.go:553:       fmt.Println()
./handlers/people.go:572:               fmt.Println(err)
./handlers/people.go:578:               fmt.Println("id is 0")
./handlers/people.go:585:               fmt.Println("existing id is 0")
./handlers/people.go:590:               fmt.Println("keys dont match")
./handlers/people.go:622:               fmt.Println("GET error:", err)
./handlers/people.go:631:               fmt.Println("json unmarshall error", err)
./handlers/people.go:655:               fmt.Println("GET error:", err)
./handlers/people.go:665:               fmt.Println("json unmarshall error", err)
./handlers/people.go:681:               fmt.Println(err)
./handlers/people.go:687:               fmt.Println("Badge cannot be Empty")
./handlers/people.go:693:               fmt.Println("Action cannot be Empty")
./handlers/people.go:699:               fmt.Println("Invalid action in Request")
./handlers/people.go:705:               fmt.Println("tribeId cannot be Empty")
./handlers/people.go:712:               fmt.Println(err)
./handlers/people.go:718:               fmt.Println("no pubkey from auth")
./handlers/people.go:726:               fmt.Println(pubKeyFromAuth)
./handlers/people.go:727:               fmt.Println("mismatched pubkey")
./handlers/ticket.go:84:                fmt.Println("[ticket] no pubkey from auth")
./handlers/ticket.go:209:               fmt.Println("[ticket] no pubkey from auth")
./handlers/ticket.go:243:               fmt.Println("[ticket] no pubkey from auth")
./handlers/ticket.go:627:               fmt.Println("no pubkey from auth")
./handlers/tribes.go:94:                fmt.Println(err)
./handlers/tribes.go:106:               fmt.Println(err)
./handlers/tribes.go:142:               fmt.Println(err)
./handlers/tribes.go:217:               fmt.Println(err)
./handlers/tribes.go:223:               fmt.Println("createOrEditTribe no uuid")
./handlers/tribes.go:232:               fmt.Println("extract UUID error", err)
./handlers/tribes.go:241:                       fmt.Println("createOrEditTribe pubkeys dont match")
./handlers/tribes.go:252:                       fmt.Println("createOrEditTribe tribe.ownerPubKey not match")
./handlers/tribes.go:253:                       fmt.Println(existing.OwnerPubKey)
./handlers/tribes.go:254:                       fmt.Println(extractedPubkey)
./handlers/tribes.go:266:               fmt.Println("=> ERR createOrEditTribe", err)
./handlers/tribes.go:287:               fmt.Println(err)
./handlers/tribes.go:319:               fmt.Println(err)
./handlers/tribes.go:353:               fmt.Println(err)
./handlers/tribes.go:368:               fmt.Println(err)
./handlers/tribes.go:376:               fmt.Println(err)
./handlers/tribes.go:424:               fmt.Println(err)
./handlers/tribes.go:441:               fmt.Println(err)
./handlers/tribes.go:472:               fmt.Println(err)
./handlers/tribes.go:480:               fmt.Println(err)
./handlers/tribes.go:573:               fmt.Println(err)
./handlers/tribes.go:581:               fmt.Println(err)
./handlers/tribes.go:665:               fmt.Println(err)
./handlers/tribes.go:673:               fmt.Println(err)
./handlers/workspaces.go:49:            fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:61:            fmt.Println("[workspaces] ", err)
./handlers/workspaces.go:69:            fmt.Printf("[workspaces] invalid workspace name %s\n", workspace.Name)
./handlers/workspaces.go:76:            fmt.Printf("[workspaces] invalid workspace name %s\n", workspace.Description)
./handlers/workspaces.go:85:                    fmt.Println("[workspaces] mismatched pubkey")
./handlers/workspaces.go:86:                    fmt.Println("[workspaces] Auth pubkey:", pubKeyFromAuth)
./handlers/workspaces.go:87:                    fmt.Println("[workspaces] OwnerPubKey:", workspace.OwnerPubKey)
./handlers/workspaces.go:113:                   fmt.Println("[workspaces] cant edit non existing")
./handlers/workspaces.go:180:           fmt.Println("[body] ", err)
./handlers/workspaces.go:195:           fmt.Println("[workspaces] ", err)
./handlers/workspaces.go:201:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:267:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:296:           fmt.Println("[body] ", err)
./handlers/workspaces.go:308:           fmt.Println("[workspaces]", err)
./handlers/workspaces.go:314:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:365:           fmt.Println("[body] ", err)
./handlers/workspaces.go:373:           fmt.Println("[workspaces]:", err)
./handlers/workspaces.go:468:           fmt.Println("[workspaces] provide user id")
./handlers/workspaces.go:486:           fmt.Println("[workspaces] provide user id")
./handlers/workspaces.go:585:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:631:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:671:           fmt.Println("no pubkey from auth")
./handlers/workspaces.go:725:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:763:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:810:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:825:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:846:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:854:           fmt.Println("[workspaces]", msg)
./handlers/workspaces.go:863:           fmt.Println(msg, err)
./handlers/workspaces.go:877:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:888:           fmt.Println("[workspaces]", err)
./handlers/workspaces.go:896:                   fmt.Println("[workspaces] mismatched pubkey")
./handlers/workspaces.go:897:                   fmt.Println("Auth Pubkey:", pubKeyFromAuth)
./handlers/workspaces.go:898:                   fmt.Println("OwnerPubKey:", workspace.OwnerPubKey)
./handlers/workspaces.go:928:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:939:           fmt.Println("[workspaces]", err)
./handlers/workspaces.go:988:           fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:1004:          fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:1013:          fmt.Println("[workspaces] workspace repository not found:", err)
./handlers/workspaces.go:1029:          fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:1047:          fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:1082:          fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:1138:          fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:1149:          fmt.Println("[workspaces]", err)
./handlers/workspaces.go:1189:          fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:1197:          fmt.Println("[workspaces] code graph not found:", err)
./handlers/workspaces.go:1212:          fmt.Println("[workspaces] no pubkey from auth")
./handlers/workspaces.go:1234:          fmt.Println("[workspaces] no pubkey from auth")
@AhsanFarooqDev
Copy link
Contributor

@kevkevinpal can I help here?

@MahtabBukhari
Copy link
Contributor

@kevkevinpal please assign me?

@saithsab877
Copy link
Contributor

saithsab877 commented Dec 23, 2024

@kevkevinpal assign me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants