This repository has been archived by the owner on Nov 7, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 docs(README.md): update links to Extending Chloe and User Managemen…
…t wiki pages 🚀 feat(logging.go): add function to log cost 🚀 feat(monitors.go): add function to monitor cost
- Loading branch information
1 parent
3d25cfd
commit 86fbbc0
Showing
3 changed files
with
19 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package cost | ||
|
||
import "github.com/kamushadenes/chloe/logging" | ||
|
||
func logCost(msg string) { | ||
logger := logging.GetLogger() | ||
|
||
l := logger.Info() | ||
|
||
for _, k := range GetCategories() { | ||
l = l.Float64(k, GetCategoryCost(k)) | ||
} | ||
|
||
l = l.Float64("total", GetTotalSessionCost()) | ||
|
||
l.Msg(msg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters