mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-13 08:12:40 +10:00
Logging (#131)
* ci: pull version from package.json on build * fix: implicit any type * feat: inital support for logger * style: fix lint * feat: move more logging over to pino * fix: logging around company importing
This commit is contained in:
@ -7,6 +7,7 @@ import authManager, {
|
||||
checkHashArgon2,
|
||||
checkHashBcrypt,
|
||||
} from "~/server/internal/auth";
|
||||
import { logger } from "~/server/internal/logging";
|
||||
|
||||
const signinValidator = type({
|
||||
username: "string",
|
||||
@ -28,7 +29,7 @@ export default defineEventHandler<{
|
||||
const body = signinValidator(await readBody(h3));
|
||||
if (body instanceof type.errors) {
|
||||
// hover out.summary to see validation errors
|
||||
console.error(body.summary);
|
||||
logger.error(body.summary);
|
||||
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import notificationSystem from "~/server/internal/notifications";
|
||||
import aclManager from "~/server/internal/acls";
|
||||
import { logger } from "~/server/internal/logging";
|
||||
|
||||
// TODO add web socket sessions for horizontal scaling
|
||||
// Peer ID to user ID
|
||||
@ -29,7 +30,7 @@ export default defineWebSocketHandler({
|
||||
async close(peer, _details) {
|
||||
const userId = socketSessions.get(peer.id);
|
||||
if (!userId) {
|
||||
console.log(`skipping websocket close for ${peer.id}`);
|
||||
logger.info(`skipping websocket close for ${peer.id}`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user