Skip to content

Commit

Permalink
add startup logs
Browse files Browse the repository at this point in the history
  • Loading branch information
aditsachde committed Jul 24, 2024
1 parent 858d734 commit 78dc56f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/ctsubmit/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ func LoadLog(ctx context.Context, kvpath, consulAddress string) (*Log, error) {
// Get the latest STH
var sth ct.SignedTreeHead
{
log.Println("Fetching latest STH")
sthBytes, err := bucket.Get(ctx, "ct/v1/get-sth")
if err != nil {
return nil, fmt.Errorf("unable to fetch STH: %v", err)
Expand Down Expand Up @@ -314,6 +315,7 @@ func LoadLog(ctx context.Context, kvpath, consulAddress string) (*Log, error) {
Hash: tlog.Hash(sth.SHA256RootHash),
}, &sunlight.TileReader{
Fetch: func(key string) ([]byte, error) {
log.Println("Fetching tile", key)
return bucket.Get(ctx, key)
}, SaveTilesInt: func(tiles []tlog.Tile, data [][]byte) {
for i, tile := range tiles {
Expand Down Expand Up @@ -356,6 +358,8 @@ func LoadLog(ctx context.Context, kvpath, consulAddress string) (*Log, error) {
}
}

log.Println("Log loaded successfully")

return &Log{
config: gc,
eStop: lock,
Expand Down
2 changes: 2 additions & 0 deletions internal/ctsubmit/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ func MainMain(ctx context.Context, listener net.Listener, kvpath, consulAddress
log.Fatalf("Failed to create log object: %v", err)
}

log.Println("Starting CT log")

mux, err := ctloghandle.Start(context.Background())
if err != nil {
log.Fatalf("Failed to get log handler: %v", err)
Expand Down

0 comments on commit 78dc56f

Please sign in to comment.