mirror of
https://github.com/HeyPuter/puter.git
synced 2025-12-30 09:40:00 -06:00
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:
@@ -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' ) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user