devex: disable logs for missing fsentries and cache

Often fsentry stats are used to see if an fsentry exists, so fsentry not
found logs are common and expected. This commit disables those by
default. Additionally, logging for cache events is disabled as well,
since those are only helpful when debugging cache specifically.
This commit is contained in:
KernelDeimos
2025-10-10 16:55:31 -04:00
committed by Eric Dubé
parent 441622d526
commit 0b6b871144
2 changed files with 14 additions and 2 deletions

View File

@@ -47,6 +47,13 @@ class PuterFSProvider extends putility.AdvancedBase {
_path: require('path'),
uuidv4: require('uuid').v4,
config: require('../../../config.js'),
};
constructor (...a) {
super(...a);
this.log_fsentriesNotFound = (this.modules.config.logging ?? [])
.includes('fsentries-not-found');
}
get_capabilities () {
@@ -185,7 +192,9 @@ class PuterFSProvider extends putility.AdvancedBase {
}
if ( ! entry ) {
controls.log.warn(`entry not found: ${selector.describe(true)}`);
if ( this.log_fsentriesNotFound ) {
controls.log.warn(`entry not found: ${selector.describe(true)}`);
}
}
if ( entry === null || typeof entry !== 'object' ) {

View File

@@ -53,7 +53,7 @@ class FileCacheService extends AdvancedBase {
path_: require('path'),
}
constructor ({ services, my_config }) {
constructor ({ services, my_config, config: global_config }) {
super({ services });
this.log = services.get('log-service').create(this.constructor.name);
@@ -74,6 +74,9 @@ class FileCacheService extends AdvancedBase {
initial: 0.5,
alpha: 0.2,
});
this.logging_enabled = (global_config.logging ?? [])
.includes('file-cache');
this.init();