refactor(logging): centralize console output
This commit is contained in:
@@ -25,6 +25,9 @@ import { AuthTextField } from "./auth-text-field";
|
||||
import { AuthPrimaryButton } from "./auth-primary-button";
|
||||
import { AuthErrorMessage } from "./auth-error-message";
|
||||
import styles from "./email-form.module.css";
|
||||
import { Logger } from "@/utils";
|
||||
|
||||
const log = new Logger("AppAuthComponentsEmailRegisterForm");
|
||||
|
||||
export interface EmailRegisterFormProps {
|
||||
globalError?: string | null;
|
||||
@@ -66,7 +69,7 @@ export function EmailRegisterForm({
|
||||
};
|
||||
|
||||
const submit = () => {
|
||||
console.log("[email-register-form] submit ENTRY", {
|
||||
log.debug("[email-register-form] submit ENTRY", {
|
||||
emailLength: email.length,
|
||||
emailPreview: email.slice(0, 8),
|
||||
passwordLength: password.length,
|
||||
@@ -81,7 +84,7 @@ export function EmailRegisterForm({
|
||||
// 按 username → email → password → confirm 顺序挑第一个错(与字段顺序一致)
|
||||
const firstErr =
|
||||
usernameErr ?? emailErr ?? passwordErr ?? confirmErr ?? null;
|
||||
console.warn(
|
||||
log.warn(
|
||||
"[email-register-form] submit VALIDATION FAILED (silent return)",
|
||||
{
|
||||
emailErr,
|
||||
@@ -95,7 +98,7 @@ export function EmailRegisterForm({
|
||||
return;
|
||||
}
|
||||
setValidationError(null);
|
||||
console.log(
|
||||
log.debug(
|
||||
"[email-register-form] submit dispatching AuthEmailRegisterSubmitted",
|
||||
);
|
||||
dispatch({
|
||||
|
||||
Reference in New Issue
Block a user