mirror of
https://github.com/nextcloud/server.git
synced 2025-05-01 20:40:30 +00:00

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de> Signed-off-by: Marco Ambrosini <marcoambrosini@icloud.com>
26 lines
573 B
JavaScript
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()
|