Change some misleading logs

This commit is contained in:
SebClem 2024-09-11 15:51:47 +02:00
parent d8d191ed48
commit 86ef57e8d3
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -152,7 +152,7 @@ export function getBackups(
config: WebdavConfig, config: WebdavConfig,
nameTemplate: string nameTemplate: string
) { ) {
logger.info("Download backup form webdav"); logger.debug("Getting backup list form webdav");
const status = statusTools.getStatus(); const status = statusTools.getStatus();
if (!status.webdav.logged_in && !status.webdav.folder_created) { if (!status.webdav.logged_in && !status.webdav.folder_created) {
return Promise.reject(new Error("Not logged in")); return Promise.reject(new Error("Not logged in"));
@ -173,7 +173,6 @@ export function getBackups(
const data = parseXmlBackupData(value.body, config).sort( const data = parseXmlBackupData(value.body, config).sort(
(a, b) => b.lastEdit.toMillis() - a.lastEdit.toMillis() (a, b) => b.lastEdit.toMillis() - a.lastEdit.toMillis()
); );
logger.info("Download success");
return extractBackupInfo(data, nameTemplate); return extractBackupInfo(data, nameTemplate);
}, },
(reason: RequestError) => { (reason: RequestError) => {
@ -212,7 +211,7 @@ function extractBackupInfo(backups: WebdavBackup[], template: string) {
} }
export function deleteBackup(pathToDelete: string, config: WebdavConfig) { export function deleteBackup(pathToDelete: string, config: WebdavConfig) {
logger.info(`Deleting Cloud backup ${pathToDelete}`); logger.debug(`Deleting Cloud backup ${pathToDelete}`);
const endpoint = getEndpoint(config); const endpoint = getEndpoint(config);
return got return got
.delete(urlJoin(config.url, endpoint, pathToDelete), { .delete(urlJoin(config.url, endpoint, pathToDelete), {
@ -227,7 +226,7 @@ export function deleteBackup(pathToDelete: string, config: WebdavConfig) {
}) })
.then( .then(
(response) => { (response) => {
logger.info("Delete success"); logger.debug("...Ok");
return response; return response;
}, },
(reason: RequestError) => { (reason: RequestError) => {
@ -307,7 +306,7 @@ export function webdavUploadFile(
statusTools.setStatus(status); statusTools.setStatus(status);
} }
if (percent >= 1) { if (percent >= 1) {
logger.info("Upload done..."); logger.info("Upload done");
} }
}) })
.on("response", (res: PlainResponse) => { .on("response", (res: PlainResponse) => {