refactor: replace console.debug with console.log for improved logging consistency
- Updated various components and services to replace console.debug statements with console.log for better visibility in logs. - This change enhances the logging approach across the application, ensuring that important messages are consistently logged.
This commit is contained in:
parent
187726ae8d
commit
e760b1be6b
@ -98,7 +98,7 @@ export default class ClipboardMonitor {
|
|||||||
private handleTextSelected(text: string) {
|
private handleTextSelected(text: string) {
|
||||||
if (!text) return
|
if (!text) return
|
||||||
|
|
||||||
console.debug('[ClipboardMonitor] handleTextSelected', text)
|
console.log('[ClipboardMonitor] handleTextSelected', text)
|
||||||
|
|
||||||
windowService.setLastSelectedText(text)
|
windowService.setLastSelectedText(text)
|
||||||
|
|
||||||
|
|||||||
@ -334,7 +334,6 @@ class KnowledgeService {
|
|||||||
): LoaderTask {
|
): LoaderTask {
|
||||||
const { base, item, forceReload } = options
|
const { base, item, forceReload } = options
|
||||||
const content = item.content as string
|
const content = item.content as string
|
||||||
console.debug('chunkSize', base.chunkSize)
|
|
||||||
|
|
||||||
const encoder = new TextEncoder()
|
const encoder = new TextEncoder()
|
||||||
const contentBytes = encoder.encode(content)
|
const contentBytes = encoder.encode(content)
|
||||||
@ -470,7 +469,7 @@ class KnowledgeService {
|
|||||||
{ uniqueId, uniqueIds, base }: { uniqueId: string; uniqueIds: string[]; base: KnowledgeBaseParams }
|
{ uniqueId, uniqueIds, base }: { uniqueId: string; uniqueIds: string[]; base: KnowledgeBaseParams }
|
||||||
): Promise<void> => {
|
): Promise<void> => {
|
||||||
const ragApplication = await this.getRagApplication(base)
|
const ragApplication = await this.getRagApplication(base)
|
||||||
console.debug(`[ KnowledgeService Remove Item UniqueId: ${uniqueId}]`)
|
console.log(`[ KnowledgeService Remove Item UniqueId: ${uniqueId}]`)
|
||||||
for (const id of uniqueIds) {
|
for (const id of uniqueIds) {
|
||||||
await ragApplication.deleteLoader(id)
|
await ragApplication.deleteLoader(id)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,6 @@ const FallbackFavicon: React.FC<FallbackFaviconProps> = ({ hostname, alt }) => {
|
|||||||
if (error.name === 'AbortError') {
|
if (error.name === 'AbortError') {
|
||||||
throw error
|
throw error
|
||||||
}
|
}
|
||||||
console.debug(`Failed to fetch favicon from ${url}:`, error)
|
|
||||||
return null // Return null for failed requests
|
return null // Return null for failed requests
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -79,7 +78,7 @@ const FallbackFavicon: React.FC<FallbackFaviconProps> = ({ hostname, alt }) => {
|
|||||||
setFaviconState({ status: 'loaded', src: url })
|
setFaviconState({ status: 'loaded', src: url })
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
console.debug('All favicon requests failed:', error)
|
console.log('All favicon requests failed:', error)
|
||||||
setFaviconState({ status: 'loaded', src: faviconUrls[0] })
|
setFaviconState({ status: 'loaded', src: faviconUrls[0] })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -31,8 +31,6 @@ const TopViewContainer: React.FC<Props> = ({ children }) => {
|
|||||||
const [messageApi, messageContextHolder] = message.useMessage()
|
const [messageApi, messageContextHolder] = message.useMessage()
|
||||||
const [modal, modalContextHolder] = Modal.useModal()
|
const [modal, modalContextHolder] = Modal.useModal()
|
||||||
|
|
||||||
console.debug('TopViewContainer', elements)
|
|
||||||
|
|
||||||
useAppInit()
|
useAppInit()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -22,7 +22,6 @@ export const useKnowledgeFiles = () => {
|
|||||||
}, [bases])
|
}, [bases])
|
||||||
|
|
||||||
const removeAllFiles = async () => {
|
const removeAllFiles = async () => {
|
||||||
console.debug('removeAllFiles', knowledgeFiles)
|
|
||||||
await FileManager.deleteFiles(knowledgeFiles)
|
await FileManager.deleteFiles(knowledgeFiles)
|
||||||
|
|
||||||
const newBases = bases.map((kb) => ({
|
const newBases = bases.map((kb) => ({
|
||||||
|
|||||||
@ -30,7 +30,6 @@ const App: FC<Props> = ({ app, onClick, size = 60 }) => {
|
|||||||
key: 'togglePin',
|
key: 'togglePin',
|
||||||
label: isPinned ? t('minapp.sidebar.remove.title') : t('minapp.sidebar.add.title'),
|
label: isPinned ? t('minapp.sidebar.remove.title') : t('minapp.sidebar.add.title'),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
console.debug('togglePin', app)
|
|
||||||
const newPinned = isPinned ? pinned.filter((item) => item.id !== app.id) : [...(pinned || []), app]
|
const newPinned = isPinned ? pinned.filter((item) => item.id !== app.id) : [...(pinned || []), app]
|
||||||
updatePinnedMinapps(newPinned)
|
updatePinnedMinapps(newPinned)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -103,7 +103,6 @@ const KnowledgeContent: FC<KnowledgeContentProps> = ({ selectedBase }) => {
|
|||||||
created_at: new Date().toISOString()
|
created_at: new Date().toISOString()
|
||||||
}))
|
}))
|
||||||
.filter(({ ext }) => fileTypes.includes(ext))
|
.filter(({ ext }) => fileTypes.includes(ext))
|
||||||
console.debug('[KnowledgeContent] Uploading files:', _files, files)
|
|
||||||
const uploadedFiles = await FileManager.uploadFiles(_files)
|
const uploadedFiles = await FileManager.uploadFiles(_files)
|
||||||
addFiles(uploadedFiles)
|
addFiles(uploadedFiles)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,6 @@ const AssistantModelSettings: FC<Props> = ({ assistant, updateAssistant, updateA
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
const onTemperatureChange = (value) => {
|
const onTemperatureChange = (value) => {
|
||||||
console.debug('[onTemperatureChange]', value)
|
|
||||||
if (!isNaN(value as number)) {
|
if (!isNaN(value as number)) {
|
||||||
updateAssistantSettings({ temperature: value })
|
updateAssistantSettings({ temperature: value })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,8 +19,6 @@ const MCPSettings: FC = () => {
|
|||||||
const { Paragraph, Text } = Typography
|
const { Paragraph, Text } = Typography
|
||||||
const mcpServers = useAppSelector((state) => state.mcp.servers)
|
const mcpServers = useAppSelector((state) => state.mcp.servers)
|
||||||
|
|
||||||
console.debug(mcpServers)
|
|
||||||
|
|
||||||
const handleDelete = (serverName: string) => {
|
const handleDelete = (serverName: string) => {
|
||||||
window.modal.confirm({
|
window.modal.confirm({
|
||||||
title: t('settings.mcp.confirmDelete'),
|
title: t('settings.mcp.confirmDelete'),
|
||||||
|
|||||||
@ -155,7 +155,7 @@ class KnowledgeQueue {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
console.debug(`[KnowledgeQueue] Updated uniqueId for item ${item.id} in base ${baseId} `)
|
console.log(`[KnowledgeQueue] Updated uniqueId for item ${item.id} in base ${baseId} `)
|
||||||
|
|
||||||
store.dispatch(clearCompletedProcessing({ baseId }))
|
store.dispatch(clearCompletedProcessing({ baseId }))
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class FileManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static async uploadFile(file: FileType): Promise<FileType> {
|
static async uploadFile(file: FileType): Promise<FileType> {
|
||||||
console.debug(`[FileManager] Uploading file: ${JSON.stringify(file)}`)
|
console.log(`[FileManager] Uploading file: ${JSON.stringify(file)}`)
|
||||||
|
|
||||||
const uploadFile = await window.api.file.upload(file)
|
const uploadFile = await window.api.file.upload(file)
|
||||||
const fileRecord = await db.files.get(uploadFile.id)
|
const fileRecord = await db.files.get(uploadFile.id)
|
||||||
@ -60,7 +60,7 @@ class FileManager {
|
|||||||
static async deleteFile(id: string, force: boolean = false): Promise<void> {
|
static async deleteFile(id: string, force: boolean = false): Promise<void> {
|
||||||
const file = await this.getFile(id)
|
const file = await this.getFile(id)
|
||||||
|
|
||||||
console.debug('[FileManager] Deleting file:', file)
|
console.log('[FileManager] Deleting file:', file)
|
||||||
|
|
||||||
if (!file) {
|
if (!file) {
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user