Suppress GET /queue logs unless --verbose
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,6 +15,7 @@ function ts() {
|
|||||||
|
|
||||||
const PORT = process.env.CONDUIT_PORT || 3015;
|
const PORT = process.env.CONDUIT_PORT || 3015;
|
||||||
const BIND = get_arg(process.argv, '--bind') || process.env.CONDUIT_BIND || '127.0.0.1';
|
const BIND = get_arg(process.argv, '--bind') || process.env.CONDUIT_BIND || '127.0.0.1';
|
||||||
|
const VERBOSE = process.argv.includes('--verbose');
|
||||||
|
|
||||||
const secrets_path = get_arg(process.argv, '--secrets');
|
const secrets_path = get_arg(process.argv, '--secrets');
|
||||||
let secrets;
|
let secrets;
|
||||||
@@ -35,7 +36,10 @@ app.use(express.json({
|
|||||||
app.use(create_auth_middleware(users));
|
app.use(create_auth_middleware(users));
|
||||||
|
|
||||||
app.use((req, _res, next) => {
|
app.use((req, _res, next) => {
|
||||||
|
const is_debug = req.method === 'GET' && req.path === '/queue';
|
||||||
|
if (!is_debug || VERBOSE) {
|
||||||
console.log(`[${ts()}] ${req.method} ${req.path} — ${req.conduit_user}`);
|
console.log(`[${ts()}] ${req.method} ${req.path} — ${req.conduit_user}`);
|
||||||
|
}
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user