mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05:00
Linting: Fixed wrong logger contexts
Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
8cc9e12bc3
commit
f5039791ed
5 changed files with 7 additions and 7 deletions
|
@ -45,7 +45,7 @@ export class MediaController {
|
|||
const username = 'hardcoded';
|
||||
this.logger.debug(
|
||||
`Recieved filename '${file.originalname}' for note '${noteId}' from user '${username}'`,
|
||||
'uploadImage',
|
||||
'uploadMedia',
|
||||
);
|
||||
try {
|
||||
const url = await this.mediaService.saveFile(
|
||||
|
|
|
@ -101,7 +101,7 @@ export class MediaController {
|
|||
const username = req.user.userName;
|
||||
this.logger.debug(
|
||||
`Recieved filename '${file.originalname}' for note '${noteId}' from user '${username}'`,
|
||||
'uploadImage',
|
||||
'uploadMedia',
|
||||
);
|
||||
try {
|
||||
const url = await this.mediaService.saveFile(
|
||||
|
@ -142,7 +142,7 @@ export class MediaController {
|
|||
try {
|
||||
this.logger.debug(
|
||||
`Deleting '${filename}' for user '${username}'`,
|
||||
'deleteFile',
|
||||
'deleteMedia',
|
||||
);
|
||||
const mediaUpload = await this.mediaService.findUploadByFilename(
|
||||
filename,
|
||||
|
@ -150,7 +150,7 @@ export class MediaController {
|
|||
if (mediaUpload.user.userName !== username) {
|
||||
this.logger.warn(
|
||||
`${username} tried to delete '${filename}', but is not the owner`,
|
||||
'deleteFile',
|
||||
'deleteMedia',
|
||||
);
|
||||
throw new PermissionError(
|
||||
`File '${filename}' is not owned by '${username}'`,
|
||||
|
|
|
@ -78,7 +78,7 @@ export class ImgurBackend implements MediaBackend {
|
|||
headers: { Authorization: `Client-ID ${this.config.clientID}` },
|
||||
},
|
||||
).then((res) => ImgurBackend.checkStatus(res));
|
||||
this.logger.debug(`Response: ${result.toString()}`, 'saveFile');
|
||||
this.logger.debug(`Response: ${result.toString()}`, 'deleteFile');
|
||||
this.logger.log(`Deleted ${fileName}`, 'deleteFile');
|
||||
return;
|
||||
} catch (e) {
|
||||
|
|
|
@ -62,7 +62,7 @@ export class S3Backend implements MediaBackend {
|
|||
try {
|
||||
await this.client.removeObject(this.config.bucket, fileName);
|
||||
const url = this.getUrl(fileName);
|
||||
this.logger.log(`Deleted ${url}`, 'saveFile');
|
||||
this.logger.log(`Deleted ${url}`, 'deleteFile');
|
||||
return;
|
||||
} catch (e) {
|
||||
this.logger.error((e as Error).message, (e as Error).stack, 'saveFile');
|
||||
|
|
|
@ -95,7 +95,7 @@ export class WebdavBackend implements MediaBackend {
|
|||
},
|
||||
}).then((res) => WebdavBackend.checkStatus(res));
|
||||
const url = this.getUrl(fileName);
|
||||
this.logger.log(`Deleted ${url}`, 'saveFile');
|
||||
this.logger.log(`Deleted ${url}`, 'deleteFile');
|
||||
return;
|
||||
} catch (e) {
|
||||
this.logger.error((e as Error).message, (e as Error).stack, 'saveFile');
|
||||
|
|
Loading…
Reference in a new issue