change moderation logs again

This commit is contained in:
HF 2022-04-01 17:59:46 +02:00
parent 1b3a54224f
commit ba20d6fcf3
2 changed files with 30 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* @flow /*
* *
* functions to deal with images * functions to deal with images
* *
@ -27,14 +27,14 @@ import Palette from './Palette';
* @param height height of image * @param height height of image
*/ */
export async function imageABGR2Canvas( export async function imageABGR2Canvas(
canvasId: number, canvasId,
x: number, x,
y: number, y,
data: Buffer, data,
width: number, width,
height: number, height,
wipe?: boolean, wipe,
protect?: boolean, protect,
) { ) {
logger.info( logger.info(
`Loading image with dim ${width}/${height} to ${x}/${y}/${canvasId}`, `Loading image with dim ${width}/${height} to ${x}/${y}/${canvasId}`,
@ -108,12 +108,12 @@ export async function imageABGR2Canvas(
* it will be called with the pixelcolor as argument, its return value gets set * it will be called with the pixelcolor as argument, its return value gets set
*/ */
export async function imagemask2Canvas( export async function imagemask2Canvas(
canvasId: number, canvasId,
x: number, x,
y: number, y,
data: Buffer, data,
width: number, width,
height: number, height,
filter, filter,
) { ) {
logger.info( logger.info(
@ -180,12 +180,12 @@ export async function imagemask2Canvas(
* @param height height of image * @param height height of image
*/ */
export async function protectCanvasArea( export async function protectCanvasArea(
canvasId: number, canvasId,
x: number, x,
y: number, y,
width: number, width,
height: number, height,
protect: boolean = true, protect = true,
) { ) {
logger.info( logger.info(
// eslint-disable-next-line max-len // eslint-disable-next-line max-len

View File

@ -151,7 +151,7 @@ export async function executeImageAction(
); );
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
if (logger) logger(`Loaded image wth ${pxlCount} pixels to #${canvas.ident},${x},${y}`); if (logger) logger(`Loaded image wth ${pxlCount} pixels to #${canvas.ident},${x},${y} (${x}_${y} - ${x + info.width - 1}_${y + info.height - 1}`);
return [ return [
200, 200,
`Successfully loaded image wth ${pxlCount} pixels to ${x}/${y}`, `Successfully loaded image wth ${pxlCount} pixels to ${x}/${y}`,
@ -264,17 +264,19 @@ export async function executeProtAction(
if (logger) { if (logger) {
logger( logger(
(protect) (protect)
? `Protect ${width}x${height} area at #${canvas.ident},${x},${y}` // eslint-disable-next-line max-len
: `Unprotect ${width}x${height} area at #${canvas.ident},${x},${y}`, ? `Protect ${width}x${height} area at #${canvasid},${x},${y} with ${pxlCount}pxls (${ulcoor} - ${brcoor})`
// eslint-disable-next-line max-len
: `Unprotect ${width}x${height} area at #${canvasid},${x},${y} with ${pxlCount}pxls (${ulcoor} - ${brcoor})`,
); );
} }
return [ return [
200, 200,
(protect) (protect)
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
? `Successfully protected ${pxlCount} pixels at ${x} / ${y} with dimension ${width}x${height}` ? `Successfully protected ${width}x${height} area at #${canvasid},${x},${y} with ${pxlCount}pxls (${ulcoor} - ${brcoor})`
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
: `Soccessfully unprotected ${pxlCount} pixels at ${x} / ${y} with dimension ${width}x${height}`, : `Successfully unprotected ${width}x${height} area at #${canvasid},${x},${y} with ${pxlCount}pxls (${ulcoor} - ${brcoor})`,
]; ];
} }
@ -336,13 +338,13 @@ export async function executeRollback(
if (logger) { if (logger) {
logger( logger(
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
`Rollback to ${date} for ${pxlCount} pixels with dimension ${width}x${height} at #${canvas.ident},${x},${y}`, `Rollback to ${date} for ${width}x${height} area at #${canvas.ident},${x},${y} with ${pxlCount}pxls (${ulcoor} - ${brcoor})`,
); );
} }
return [ return [
200, 200,
// eslint-disable-next-line max-len // eslint-disable-next-line max-len
`Successfully rolled back ${pxlCount} pixels at ${x} / ${y} with dimension ${width}x${height}`, `Successfully rolled back to ${date} for ${width}x${height} area at #${canvas.ident},${x},${y} with ${pxlCount}pxls (${ulcoor} - ${brcoor})`,
]; ];
} }