devex: more log reduction (2)

This commit is contained in:
KernelDeimos
2025-10-16 18:00:04 -04:00
committed by Eric Dubé
parent 77b167eb0a
commit 5e6b628491
11 changed files with 14 additions and 28 deletions
@@ -239,7 +239,6 @@ class HLWrite extends HLFilesystemOperation {
}
if ( dest_exists ) {
console.log('DESTINATION EXISTS', dedupe_name)
if ( ! overwrite && ! dedupe_name ) {
throw APIError.create('item_with_same_name_exists', null, {
entry_name: target_name
@@ -270,7 +270,6 @@ class AppIconService extends BaseService {
icon_jobs.push((async () => {
await svc_su.sudo(async () => {
const filename = `${data.app_uid}-${size}.png`;
console.log('FILENAME', filename);
const data_url = data.data_url;
const [metadata, base64] = data_url.split(',');
const input = Buffer.from(base64, 'base64');
@@ -23,6 +23,8 @@ const { DB_READ } = require("../../services/database/consts");
const N_MONTHS = 4;
class OldAppNameService extends BaseService {
static LOG_DEBUG = true;
_init () {
this.db = this.services.get('database').get(DB_READ, 'old-app-name');
}
@@ -30,7 +32,7 @@ class OldAppNameService extends BaseService {
async ['__on_boot.consolidation'] () {
const svc_event = this.services.get('event');
svc_event.on('app.rename', async (_, { app_uid, old_name }) => {
this.log.noticeme('GOT EVENT', { app_uid, old_name });
this.log.info('GOT EVENT', { app_uid, old_name });
await this.db.write(
'INSERT INTO `old_app_names` (`app_uid`, `name`) VALUES (?, ?)',
[app_uid, old_name]
@@ -57,7 +59,7 @@ class OldAppNameService extends BaseService {
// const n_ms = 60 * 1000;
const n_ms = N_MONTHS * 30 * 24 * 60 * 60 * 1000
this.log.noticeme('AGE INFO', {
this.log.info('AGE INFO', {
input_time: row.timestamp,
age,
n_ms,
-1
View File
@@ -52,7 +52,6 @@ class IdentifierUtil extends AdvancedBase {
// Construct a query predicate based on the keys
const key_eqs = [];
console.log('OBJECT', object, match_found)
for ( const key of match_found ) {
key_eqs.push(new Eq({
key,
+6 -11
View File
@@ -240,13 +240,8 @@ class SQLES extends BaseES {
},
async create_ (entity) {
console.log('DO WE HAVE MAPPER?', this.om);
// console.log('DO WE HAVE DATA?', data);
const sql_data = await this.get_sql_data_(entity);
console.log('SQL Data', sql_data);
const sql_cols = Object.keys(sql_data).join(', ');
const sql_placeholders = Object.keys(sql_data).map(() => '?').join(', ');
const execute_vals = Object.values(sql_data);
@@ -254,8 +249,9 @@ class SQLES extends BaseES {
const stmt =
`INSERT INTO ${this.om.sql.table_name} (${sql_cols}) VALUES (${sql_placeholders})`;
console.log('SQL STMT', stmt);
console.log('SQL VALS', execute_vals);
// Very useful when debugging! Keep these here but commented out.
// console.log('SQL STMT', stmt);
// console.log('SQL VALS', execute_vals);
const res = await this.db.write(
stmt, execute_vals
@@ -272,8 +268,6 @@ class SQLES extends BaseES {
const id_value = await entity.get(this.om.primary_identifier);
delete sql_data[this.om.primary_identifier];
console.log('SQL DATA', sql_data);
const sql_assignments = Object.keys(sql_data).map((col_name) => {
return `${col_name} = ?`;
}).join(', ');
@@ -288,8 +282,9 @@ class SQLES extends BaseES {
execute_vals.push(id_value);
console.log('SQL STMT', stmt);
console.log('SQL VALS', execute_vals);
// Very useful when debugging! Keep these here but commented out.
// console.log('SQL STMT', stmt);
// console.log('SQL VALS', execute_vals);
await this.db.write(
stmt, execute_vals
@@ -39,8 +39,6 @@ class ValidationES extends BaseES {
// return await this.om.get_client_safe((await this.upstream.update(entity)).data);
// },
async upsert (entity, extra) {
console.log('OLD ENT', extra.old_entity);
for ( const prop of Object.values(this.om.properties) ) {
if (
prop.descriptor.protected ||
@@ -81,9 +79,7 @@ class ValidationES extends BaseES {
try {
const validation_result = await prop.validate(value);
console.log('validation result', validation_result)
if ( validation_result !== true ) {
console.log('BUT KEY IS PROP NAMNE', prop.name, validation_result);
throw validation_result || APIError.create('field_invalid', null, { key: prop.name });
}
} catch ( e ) {
-2
View File
@@ -255,8 +255,6 @@ module.exports = {
const actor = Context.get('actor');
const permission = descriptor.fs_permission ?? 'see';
console.log('actor??', actor, value, permission);
const svc_acl = Context.get('services').get('acl');
if ( await value.get('path') === '/' ) {
return APIError.create('forbidden');
-2
View File
@@ -38,7 +38,6 @@ const complete_ = async ({ req, res, user }) => {
});
// send response
console.log('200 response?');
return res.send({
proceed: true,
next_step: 'complete',
@@ -155,7 +154,6 @@ router.post('/login', express.json(), body_parser_error_handler,
});
}
console.log('UMM?');
return await complete_({ req, res, user });
}else{
return res.status(400).send('Incorrect password.')
+1 -1
View File
@@ -254,7 +254,7 @@ class WSPushService extends BaseService {
const { socket_id } = metadata;
if (!socket_id) {
this.log.error('missing socket id', { metadata });
this.log.warn('missing socket id', { metadata });
}
this.log.info('socket id: ' + socket_id);
@@ -209,12 +209,12 @@ class FileCacheService extends AdvancedBase {
}
if ( tracker.phase === FileTracker.PHASE_PRECACHE ) {
if ( opt_log ) opt_log.info('obtained from precache');
if ( opt_log ) opt_log.debug('obtained from precache');
return this.precache.get(await fsNode.get('uid'));
}
if ( tracker.phase === FileTracker.PHASE_DISK ) {
if ( opt_log ) opt_log.info('obtained from disk');
if ( opt_log ) opt_log.debug('obtained from disk');
const { fs } = this.modules;
const path = this._get_path(await fsNode.get('uid'));
@@ -104,7 +104,7 @@ class RateLimitService extends BaseService {
[dbkey, ts_to_sql(window_start), 0]
);
console.log(
this.log.debug(
'CREATE window_start and count',
{ window_start, count: 0 }
);