Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: add logger utility module with debug emoji type

Adam Eivye25a98810886
diff --git a/server/lib/logger.js b/server/lib/logger.js
new file mode 100644
index 0000000000..019fb47e9b
--- /dev/null
+++ b/server/lib/logger.js
@@ -0,0 +1,84 @@
+/**
+ * Logging utility with emoji prefixes
+ * Follows PortOS single-line logging conventions
+ */
+
+/**
+ * Server startup and initialization
+ * @param {string} message - Log message
+ */
+export const startup = (message) => {
+ console.log(`🚀 ${message}`);
+};
+
+/**
+ * Processing operations
+ * @param {string} message - Log message
+ */
+export const process = (message) => {
+ console.log(`📜 ${message}`);
+};
+
+/**
+ * Error messages
+ * @param {string} message - Error message
+ */
+export const error = (message) => {
+ console.error(`❌ ${message}`);
+};
+
+/**
+ * Success messages
+ * @param {string} message - Success message
+ */
+export const success = (message) => {
+ console.log(`✅ ${message}`);
+};
+
+/**
+ * Configuration and setup
+ * @param {string} message - Config message
+ */
+export const config = (message) => {
+ console.log(`🔧 ${message}`);
+};
+
+/**
+ * New feature or celebration
+ * @param {string} message - Feature message
+ */
+export const feature = (message) => {
+ console.log(`🎉 ${message}`);
+};
+
+/**
+ * Bug or issue detection
+ * @param {string} message - Bug message
+ */
+export const bug = (message) => {
+ console.log(`🐛 ${message}`);
+};
+
+/**
+ * Information or announcement
+ * @param {string} message - Info message
+ */
+export const info = (message) => {
+ console.log(`ℹ️ ${message}`);
+};
+
+/**
+ * Warning messages
+ * @param {string} message - Warning message
+ */
+export const warning = (message) => {
+ console.warn(`⚠️ ${message}`);
+};
+
+/**
+ * Debug information (new innocuous type for testing)
+ * @param {string} message - Debug message
+ */
+export const debug = (message) => {
+ console.log(`🔍 ${message}`);
+};
diff --git a/server/lib/logger.test.js b/server/lib/logger.test.js
new file mode 100644
index 0000000000..18918073ff
--- /dev/null
+++ b/server/lib/logger.test.js
@@ -0,0 +1,70 @@
+import { describe, test, expect, beforeEach, afterEach, vi } from 'vitest';
+import * as logger from './logger.js';
+
+describe('logger', () => {
+ let consoleLogSpy;
+ let consoleErrorSpy;
+ let consoleWarnSpy;
+
+ beforeEach(() => {
+ consoleLogSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
+ consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
+ consoleWarnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {});
+ });
+
+ afterEach(() => {
+ consoleLogSpy.mockRestore();
+ consoleErrorSpy.mockRestore();
+ consoleWarnSpy.mockRestore();
+ });
+
+ test('startup logs with rocket emoji', () => {
+ logger.startup('Server started');
+ expect(consoleLogSpy).toHaveBeenCalledWith('🚀 Server started');
+ });
+
+ test('process logs with scroll emoji', () => {
+ logger.process('Processing 5 items');
+ expect(consoleLogSpy).toHaveBeenCalledWith('📜 Processing 5 items');
+ });
+
+ test('error logs with cross emoji', () => {
+ logger.error('Failed to connect');
+ expect(consoleErrorSpy).toHaveBeenCalledWith('❌ Failed to connect');
+ });
+
+ test('success logs with check emoji', () => {
+ logger.success('Operation completed');
+ expect(consoleLogSpy).toHaveBeenCalledWith('✅ Operation completed');
+ });
+
+ test('config logs with wrench emoji', () => {
+ logger.config('Configuration updated');
+ expect(consoleLogSpy).toHaveBeenCalledWith('🔧 Configuration updated');
+ });
+
+ test('feature logs with party emoji', () => {
+ logger.feature('New feature enabled');
+ expect(consoleLogSpy).toHaveBeenCalledWith('🎉 New feature enabled');
+ });
+
+ test('bug logs with bug emoji', () => {
+ logger.bug('Bug detected in module');
+ expect(consoleLogSpy).toHaveBeenCalledWith('🐛 Bug detected in module');
+ });
+
+ test('info logs with info emoji', () => {
+ logger.info('System information');
+ expect(consoleLogSpy).toHaveBeenCalledWith('ℹ️ System information');
+ });
+
+ test('warning logs with warning emoji', () => {
+ logger.warning('Deprecation warning');
+ expect(consoleWarnSpy).toHaveBeenCalledWith('⚠️ Deprecation warning');
+ });
+
+ test('debug logs with magnifying glass emoji (new type)', () => {
+ logger.debug('Debug trace information');
+ expect(consoleLogSpy).toHaveBeenCalledWith('🔍 Debug trace information');
+ });
+});