Adds in Mantis features. Enabling automated downloading of Mantises into the internal database, browsing of them, and viewing of attachments (including .msg files).

Resolves #14
This commit is contained in:
Cameron Redmore 2025-04-25 23:31:50 +01:00
parent 0e77e310bd
commit 5268d6aecd
15 changed files with 1583 additions and 44 deletions

View file

@ -0,0 +1,39 @@
import pino from 'pino';
// Initialize Pino logger
const targets = [];
// Console logging (pretty-printed in development)
if (process.env.NODE_ENV !== 'production')
{
targets.push({
target: 'pino-pretty',
options: {
colorize: true
},
level: process.env.LOG_LEVEL || 'info'
});
}
else
{
// Basic console logging in production
targets.push({
target: 'pino/file', // Log to stdout in production
options: { destination: 1 }, // 1 is stdout
level: process.env.LOG_LEVEL || 'info'
});
}
// Database logging via custom transport
targets.push({
target: './prisma-pino-transport.js', // Path to the custom transport
options: {}, // No specific options needed for this transport
level: process.env.DB_LOG_LEVEL || 'info' // Separate level for DB logging if needed
});
export const logger = pino({
level: process.env.LOG_LEVEL || 'info', // Overall minimum level
transport: {
targets: targets
}
});