mirror of
https://github.com/nextcloud/server.git
synced 2026-02-24 10:26:07 -05:00
feat(user-picker): use logger instead of console
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
This commit is contained in:
parent
00a47f1d70
commit
c0a984dfc4
4 changed files with 18 additions and 6 deletions
|
|
@ -59,6 +59,7 @@ import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
|
|||
import NcSelect from '@nextcloud/vue/components/NcSelect'
|
||||
import AccountOutline from 'vue-material-design-icons/AccountOutline.vue'
|
||||
import ArrowRightIcon from 'vue-material-design-icons/ArrowRight.vue'
|
||||
import { logger } from '../utils/logger.ts'
|
||||
|
||||
export default {
|
||||
name: 'ProfilesCustomPicker',
|
||||
|
|
@ -145,8 +146,8 @@ export default {
|
|||
isNoUser: userAutocomplete.source.startsWith('users'),
|
||||
}
|
||||
})
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
} catch (error) {
|
||||
logger.error('user_picker: error while searching for users', { error })
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
|
|
@ -168,8 +169,8 @@ export default {
|
|||
signal: this.abortController.signal,
|
||||
})
|
||||
this.reference = res.data.ocs.data.references[this.resultUrl]
|
||||
} catch (err) {
|
||||
console.error(err)
|
||||
} catch (error) {
|
||||
logger.error('user_picker: error resolving the user profile link', { error })
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,5 @@ registerCustomPickerElement('profile_picker', async (el, { providerId, accessibl
|
|||
|
||||
return new NcCustomPickerRenderResult(el, app)
|
||||
}, (el, renderResult) => {
|
||||
console.debug('Users picker custom picker destroy callback. el', el, 'renderResult:', renderResult)
|
||||
renderResult.object.unmount()
|
||||
}, 'normal')
|
||||
|
|
|
|||
11
apps/user_picker/src/utils/logger.ts
Normal file
11
apps/user_picker/src/utils/logger.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/*!
|
||||
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { getLoggerBuilder } from '@nextcloud/logger'
|
||||
|
||||
export const logger = getLoggerBuilder()
|
||||
.detectLogLevel()
|
||||
.setApp('user_picker')
|
||||
.build()
|
||||
|
|
@ -64,6 +64,7 @@ import HandshakeOutline from 'vue-material-design-icons/HandshakeOutline.vue'
|
|||
import MapMarkerOutline from 'vue-material-design-icons/MapMarkerOutline.vue'
|
||||
import TextAccount from 'vue-material-design-icons/TextAccount.vue'
|
||||
import Web from 'vue-material-design-icons/Web.vue'
|
||||
import { logger } from '../utils/logger.ts'
|
||||
|
||||
export default {
|
||||
name: 'ProfilePickerReferenceWidget',
|
||||
|
|
@ -95,7 +96,7 @@ export default {
|
|||
},
|
||||
|
||||
beforeMount() {
|
||||
console.debug('ProfilePickerReferenceWidget', this.richObject)
|
||||
logger.debug('ProfilePickerReferenceWidget', this.richObject)
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue