logger fix + chat title

This commit is contained in:
Nate Kelley 2025-07-09 15:01:59 -06:00
parent 09ba7b315a
commit 35a160301a
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
2 changed files with 7 additions and 2 deletions

View File

@ -3,10 +3,11 @@ import pino from 'pino';
const isDev = process.env.NODE_ENV !== 'production'; const isDev = process.env.NODE_ENV !== 'production';
const logLevel = process.env.LOG_LEVEL || 'info'; const logLevel = process.env.LOG_LEVEL || 'info';
let isPinoPrettyAvailable = true;
// Create base pino instance // Create base pino instance
const createBaseLogger = () => { const createBaseLogger = () => {
if (isDev) { if (isDev && isPinoPrettyAvailable) {
try { try {
// Only use pino-pretty transport in development // Only use pino-pretty transport in development
return pino({ return pino({
@ -19,6 +20,7 @@ const createBaseLogger = () => {
} catch (error) { } catch (error) {
console.warn('pino-pretty not available, falling back to JSON logging'); console.warn('pino-pretty not available, falling back to JSON logging');
console.error(error); console.error(error);
isPinoPrettyAvailable = false;
} }
} }

View File

@ -21,6 +21,10 @@ export const ChatHeaderTitle: React.FC<{
}> = React.memo(({ chatTitle, chatId, isCompletedStream }) => { }> = React.memo(({ chatTitle, chatId, isCompletedStream }) => {
const { mutateAsync: updateChat } = useUpdateChat(); const { mutateAsync: updateChat } = useUpdateChat();
if (!chatTitle) {
return null;
}
return ( return (
<AnimatePresence mode="wait" initial={!isCompletedStream}> <AnimatePresence mode="wait" initial={!isCompletedStream}>
<motion.div <motion.div
@ -29,7 +33,6 @@ export const ChatHeaderTitle: React.FC<{
className="flex w-full items-center overflow-hidden"> className="flex w-full items-center overflow-hidden">
<EditableTitle <EditableTitle
className="w-full" className="w-full"
placeholder="New chat"
level={5} level={5}
disabled={!chatTitle} disabled={!chatTitle}
id={CHAT_HEADER_TITLE_ID} id={CHAT_HEADER_TITLE_ID}