<commit_before>
Components.utils.import("file:///Users/admin/HorribleFirefoxIdea/macosx.js");

macosx.importFramework("CoreFoundation", false);
macosx.importFramework("Foundation", false);
macosx.importFramework("AppKit", false);
var message = macosx.CFStringCreateWithCString(null, "JS-MacOSX: JavaScript-Cocoa Bridge loaded into %@ v%@", macosx.kCFStringEncodingUTF8);
macosx.NSLog(message);
var prefName = macosx.CFStringCreateWithCString(null, "CatalogURL", macosx.kCFStringEncodingUTF8);
var prefDomain = macosx.CFStringCreateWithCString(null, "com.apple.SoftwareUpdate", macosx.kCFStringEncodingUTF8);
var result = macosx.CFPreferencesCopyAppValue(prefName, prefDomain);
var js_result = macosx.CFStringGetCStringPtr(result, macosx.CFStringGetFastestEncoding(result)).readString();
var message = macosx.CFStringCreateWithCString(null, "JS-MacOSX: result", macosx.kCFStringEncodingUTF8);
macosx.NSLog(message);
macosx.NSLog(result);<commit_msg>Added better logging sample<commit_after>
Components.utils.import("file:///Users/admin/HorribleFirefoxIdea/macosx.js");

var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo);
macosx.importFramework("CoreFoundation", false);
macosx.importFramework("Foundation", false);
macosx.importFramework("AppKit", false);
var message = macosx.CFStringCreateWithCString(null, "JS-MacOSX: JavaScript-Cocoa Bridge loaded into %@ v%@", macosx.kCFStringEncodingUTF8);
var appName = macosx.CFStringCreateWithCString(null, appInfo.name, macosx.kCFStringEncodingUTF8);
var appVersion = macosx.CFStringCreateWithCString(null, appInfo.version, macosx.kCFStringEncodingUTF8);
macosx.NSLog(message, appName, appVersion);
var prefName = macosx.CFStringCreateWithCString(null, "homePage", macosx.kCFStringEncodingUTF8);
var prefDomain = macosx.CFStringCreateWithCString(null, "org.mozilla.autocfg", macosx.kCFStringEncodingUTF8);
var result = macosx.CFPreferencesCopyAppValue(prefName, prefDomain);

var js_result = macosx.CFStringGetCStringPtr(result, macosx.CFStringGetFastestEncoding(result)).readString();
var message = macosx.CFStringCreateWithCString(null, "JS-MacOSX: Preference %@ result: %@", macosx.kCFStringEncodingUTF8);
macosx.NSLog(message, prefName, result);
{'fraction_non_alphanumeric': 0.12466725820763087, 'fraction_numerical': 0.0048802129547471165, 'mean_word_length': 9.841346153846153, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7290738', 'n_tokens_mistral': 755, 'n_tokens_neox': 761, 'n_words': 109}