v1.2.52 - Update nostr_core_lib to v0.4.13 and route nostr logs through relay callback logger
This commit is contained in:
@@ -51,9 +51,6 @@ let pendingSqlQueries = new Map();
|
||||
let eventRateChart = null;
|
||||
let previousTotalEvents = 0; // Track previous total for rate calculation
|
||||
|
||||
// Temporary diagnostics toggle: disable external profile relay lookups
|
||||
const DISABLE_EXTERNAL_PROFILE_RELAYS = false;
|
||||
|
||||
// Temporary diagnostics toggle: enable deep SimplePool diagnostics in nostr.bundle.js
|
||||
window.__SIMPLE_POOL_DEBUG__ = true;
|
||||
|
||||
@@ -875,20 +872,6 @@ async function loadUserProfile() {
|
||||
}
|
||||
|
||||
try {
|
||||
if (DISABLE_EXTERNAL_PROFILE_RELAYS) {
|
||||
console.warn('🧪 PROFILE RELAY TEST: External profile relays disabled; skipping profile query');
|
||||
if (headerUserName) {
|
||||
headerUserName.textContent = 'External profile lookup disabled (test mode)';
|
||||
}
|
||||
if (persistentUserName) {
|
||||
persistentUserName.textContent = 'External profile lookup disabled (test mode)';
|
||||
}
|
||||
if (persistentUserAbout) {
|
||||
persistentUserAbout.textContent = 'No external relay query performed';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Create a SimplePool instance for profile loading
|
||||
const profilePool = new window.NostrTools.SimplePool();
|
||||
const relays = ['wss://relay.damus.io',
|
||||
|
||||
+1
-1
Submodule nostr_core_lib updated: a8dc2ed046...adc7aa9dcf
File diff suppressed because one or more lines are too long
+54
@@ -186,6 +186,53 @@ int validate_event_expiration(cJSON* event, char* error_message, size_t error_si
|
||||
|
||||
// Logging functions - REMOVED (replaced by debug system in debug.c)
|
||||
|
||||
static void nostr_log_cb(int level, const char* component, const char* message, void* user_data) {
|
||||
(void)user_data;
|
||||
|
||||
const char* comp = (component && component[0]) ? component : "core";
|
||||
const char* msg = message ? message : "";
|
||||
|
||||
switch (level) {
|
||||
case NOSTR_LOG_LEVEL_ERROR:
|
||||
DEBUG_ERROR("[nostr:%s] %s", comp, msg);
|
||||
break;
|
||||
case NOSTR_LOG_LEVEL_WARN:
|
||||
DEBUG_WARN("[nostr:%s] %s", comp, msg);
|
||||
break;
|
||||
case NOSTR_LOG_LEVEL_INFO:
|
||||
DEBUG_INFO("[nostr:%s] %s", comp, msg);
|
||||
break;
|
||||
case NOSTR_LOG_LEVEL_DEBUG:
|
||||
DEBUG_LOG("[nostr:%s] %s", comp, msg);
|
||||
break;
|
||||
case NOSTR_LOG_LEVEL_TRACE:
|
||||
default:
|
||||
DEBUG_TRACE("[nostr:%s] %s", comp, msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static nostr_log_level_t nostr_log_level_from_debug_level(int debug_level) {
|
||||
if (debug_level >= DEBUG_LEVEL_TRACE) {
|
||||
return NOSTR_LOG_LEVEL_TRACE;
|
||||
}
|
||||
if (debug_level >= DEBUG_LEVEL_DEBUG) {
|
||||
return NOSTR_LOG_LEVEL_DEBUG;
|
||||
}
|
||||
if (debug_level >= DEBUG_LEVEL_INFO) {
|
||||
return NOSTR_LOG_LEVEL_INFO;
|
||||
}
|
||||
if (debug_level >= DEBUG_LEVEL_WARN) {
|
||||
return NOSTR_LOG_LEVEL_WARN;
|
||||
}
|
||||
if (debug_level >= DEBUG_LEVEL_ERROR) {
|
||||
return NOSTR_LOG_LEVEL_ERROR;
|
||||
}
|
||||
|
||||
// Production-safe default for systemd/journald deployments.
|
||||
return NOSTR_LOG_LEVEL_INFO;
|
||||
}
|
||||
|
||||
// Update subscription manager configuration from config system
|
||||
void update_subscription_manager_config(void) {
|
||||
g_subscription_manager.max_subscriptions_per_client = get_config_int("max_subscriptions_per_client", MAX_SUBSCRIPTIONS_PER_CLIENT);
|
||||
@@ -1927,6 +1974,12 @@ int main(int argc, char* argv[]) {
|
||||
|
||||
DEBUG_LOG("Nostr library initialized");
|
||||
|
||||
// Route nostr_core_lib logs into relay logging pipeline (stdout/stderr -> journald or relay.log)
|
||||
nostr_set_log_callback(nostr_log_cb, NULL);
|
||||
nostr_log_level_t nostr_level = nostr_log_level_from_debug_level(cli_options.debug_level);
|
||||
nostr_set_log_level(nostr_level);
|
||||
DEBUG_INFO("Nostr callback logging initialized at level %d", (int)nostr_level);
|
||||
|
||||
// Check if this is first-time startup or existing relay
|
||||
if (is_first_time_startup()) {
|
||||
DEBUG_LOG("First-time startup detected");
|
||||
@@ -2192,6 +2245,7 @@ int main(int argc, char* argv[]) {
|
||||
pthread_mutex_destroy(&g_subscription_manager.subscriptions_lock);
|
||||
pthread_mutex_destroy(&g_subscription_manager.ip_tracking_lock);
|
||||
|
||||
nostr_set_log_callback(NULL, NULL);
|
||||
nostr_cleanup();
|
||||
close_database();
|
||||
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@
|
||||
// Using CRELAY_ prefix to avoid conflicts with nostr_core_lib VERSION macros
|
||||
#define CRELAY_VERSION_MAJOR 1
|
||||
#define CRELAY_VERSION_MINOR 2
|
||||
#define CRELAY_VERSION_PATCH 51
|
||||
#define CRELAY_VERSION "v1.2.51"
|
||||
#define CRELAY_VERSION_PATCH 52
|
||||
#define CRELAY_VERSION "v1.2.52"
|
||||
|
||||
// Relay metadata (authoritative source for NIP-11 information)
|
||||
#define RELAY_NAME "C-Relay"
|
||||
|
||||
Reference in New Issue
Block a user