mirror of https://github.com/buster-so/buster.git
logger fix + chat title
This commit is contained in:
parent
09ba7b315a
commit
35a160301a
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in New Issue