From 2f957068e567391e7aef5d7a2c075c14c1e6b37a Mon Sep 17 00:00:00 2001 From: turret Date: Fri, 24 Nov 2023 00:57:35 -0600 Subject: misc: subsys upgrade, log timestamps (log) - create LOGLEVEL constant numbers - implement CONSOLE_LOGLEVEL - color array now uses loglevel constants - timestamp now shown (thanks util-linux) (init) - register mainpid - hello world print - fix process reaper to refer to subsys when reaping (subsys) - create maximum subsystem count - create subsystem table - add debugging prints to subsystem entry and termination - create function to handle process termination (unmap stack, free subsystem malloc, clear entry in table) - disable subsystem inception - change die references to fail with print - supply clone with signal to send on termination (SIGCHLD) --- include/log.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/log.h b/include/log.h index 52d45ff..397ce2b 100644 --- a/include/log.h +++ b/include/log.h @@ -2,6 +2,18 @@ #define LOG_SOH "\001" #define LOG_SOH_ASCII '\001' +#define EMERG_LOGLEVEL 0 +#define ALERT_LOGLEVEL 1 +#define CRIT_LOGLEVEL 2 +#define ERR_LOGLEVEL 3 +#define WARNING_LOGLEVEL 4 +#define NOTICE_LOGLEVEL 5 +#define INFO_LOGLEVEL 6 +#define DEBUG_LOGLEVEL 7 + +#define DEFAULT_LOGLEVEL NOTICE_LOGLEVEL +#define CONSOLE_LOGLEVEL DEBUG_LOGLEVEL + #define LOG_EMERG LOG_SOH "0" #define LOG_ALERT LOG_SOH "1" #define LOG_CRIT LOG_SOH "2" -- cgit v1.2.3