mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-12 20:40:52 +00:00
devex: misc. log changes
- removes extra log from dev socket service - changes SYSTEM logs so they don't look like warnings - adds optional hiding of INFO label
This commit is contained in:
@@ -22,7 +22,7 @@ const LOG_LEVEL_ERRO = logSeverity(0, 'ERRO', '31;1', 'error');
|
||||
const LOG_LEVEL_WARN = logSeverity(1, 'WARN', '33;1', 'warn');
|
||||
const LOG_LEVEL_INFO = logSeverity(2, 'INFO', '36;1', 'info');
|
||||
const LOG_LEVEL_NOTICEME = logSeverity(3, 'NOTICE_ME', '33;1', 'error');
|
||||
const LOG_LEVEL_SYSTEM = logSeverity(3, 'SYSTEM', '33;1', 'system');
|
||||
const LOG_LEVEL_SYSTEM = logSeverity(3, 'SYSTEM', '36;1', 'system');
|
||||
const LOG_LEVEL_DEBU = logSeverity(4, 'DEBU', '37', 'debug');
|
||||
const LOG_LEVEL_TICK = logSeverity(10, 'TICK', '34;1', 'info');
|
||||
|
||||
|
||||
@@ -56,12 +56,21 @@ const stringify_log_entry = ({ prefix, log_lvl, crumbs, message, fields, objects
|
||||
}
|
||||
|
||||
m += prefix ? `${prefix} ` : '';
|
||||
m += `\x1B[${log_lvl.esc}m[${log_lvl.label}\x1B[0m`;
|
||||
let levelLabelShown = false;
|
||||
if ( log_lvl.label !== 'INFO' || ! config.log_hide_info_label ) {
|
||||
levelLabelShown = true;
|
||||
m += `\x1B[${log_lvl.esc}m[${log_lvl.label}\x1B[0m`;
|
||||
} else {
|
||||
m += `\x1B[${log_lvl.esc}m[\x1B[0m`;
|
||||
}
|
||||
for ( let crumb of crumbs ) {
|
||||
if ( crumb.startsWith('extension/') ) {
|
||||
crumb = `\x1B[34;1m${crumb}\x1B[0m`;
|
||||
}
|
||||
m += `::${crumb}`;
|
||||
if ( levelLabelShown ) {
|
||||
m += '::';
|
||||
} else levelLabelShown = true;
|
||||
m += crumb;
|
||||
}
|
||||
m += `\x1B[${log_lvl.esc}m]\x1B[0m`;
|
||||
if ( fields.timestamp ) {
|
||||
|
||||
@@ -15,7 +15,6 @@ Try entering the 'help' command.
|
||||
|
||||
class DevSocketService extends BaseService {
|
||||
async ['__on_boot.consolidation'] () {
|
||||
this.log.noticeme('dev socket service');
|
||||
this.sock = process.env.DEV_SOCKET_PATH ??
|
||||
path_.join(process.cwd(), 'dev.sock');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user