0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-05-01 20:40:30 +00:00
nextcloud_server/core/src/logger.js
Marco Ambrosini 6ee965f0d9
feat: Add in-app search
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Marco Ambrosini <marcoambrosini@icloud.com>
2024-06-27 12:13:14 +02:00

26 lines
573 B
JavaScript

/**
* SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { getCurrentUser } from '@nextcloud/auth'
import { getLoggerBuilder } from '@nextcloud/logger'
const getLogger = user => {
if (user === null) {
return getLoggerBuilder()
.setApp('core')
.build()
}
return getLoggerBuilder()
.setApp('core')
.setUid(user.uid)
.build()
}
export default getLogger(getCurrentUser())
export const unifiedSearchLogger = getLoggerBuilder()
.setApp('unified-search')
.detectUser()
.build()