Compare commits

...

1 Commits

Author SHA1 Message Date
bcmmbaga
24053750d9 add debug logs for user state change
Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
2025-04-30 15:21:01 +03:00
2 changed files with 8 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ import (
"os"
"reflect"
"regexp"
"runtime/debug"
"slices"
"strconv"
"strings"
@@ -1054,6 +1055,9 @@ func (am *DefaultAccountManager) addNewUserToDomainAccount(ctx context.Context,
return "", err
}
log.WithContext(ctx).Debugf("created new regular user ID: %s, domainAccountId: %s, accountID: %s Trace: %s", userAuth.UserId,
domainAccountID, userAuth.AccountId, debug.Stack(),
)
am.StoreEvent(ctx, userAuth.UserId, userAuth.UserId, domainAccountID, activity.UserJoined, nil)
return domainAccountID, nil

View File

@@ -209,6 +209,10 @@ func (s *SqlStore) SaveAccount(ctx context.Context, account *types.Account) erro
if s.metrics != nil {
s.metrics.StoreMetrics().CountPersistenceDuration(took)
}
data, _ := json.MarshalIndent(account, "", " ")
log.WithContext(ctx).Debugf("saved an account Account ID: %s, state: %s Trace: %s", account.Id, data, debug.Stack())
log.WithContext(ctx).Debugf("took %d ms to persist an account to the store", took.Milliseconds())
return err