{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2026-09-30T09:18:25Z","object_id":{"id":1303,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_wires","title":"mod_wires","uri":"https:\/\/zotonic.com\/id\/1303"},"seq":1}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"subject":{"objects":[{"created":"2026-09-30T09:18:25Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-30T09:18:25Z","object_id":{"id":2563,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_frontend_developer","title":"Frontend developer","uri":"https:\/\/zotonic.com\/id\/2563"},"seq":2},{"created":"2026-09-30T09:18:25Z","object_id":{"id":2607,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_logging_and_monitoring","title":"Logging and monitoring","uri":"https:\/\/zotonic.com\/id\/2607"},"seq":3},{"created":"2026-09-30T09:18:25Z","object_id":{"id":2613,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_development_and_debugging","title":"Development and debugging","uri":"https:\/\/zotonic.com\/id\/2613"},"seq":4},{"created":"2026-09-30T09:18:25Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":5},{"created":"2026-09-30T09:18:25Z","object_id":{"id":2673,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_javascript","title":"JavaScript","uri":"https:\/\/zotonic.com\/id\/2673"},"seq":6},{"created":"2026-09-30T09:18:25Z","object_id":{"id":2718,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_cotonic","title":"Cotonic","uri":"https:\/\/zotonic.com\/id\/2718"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2751,"is_a":["text","documentation","reference","cotonic_reference","cotonic_model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2751"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_zotonic_cotonic_model_console","page_url":{"en":"https:\/\/zotonic.com\/cotonic\/zotonic-models\/console","x-default":"https:\/\/zotonic.com\/cotonic\/zotonic-models\/console"},"preview_url":null,"resource":{"version":19,"pivot_location_lat":null,"title":"model\/console","is_authoritative":true,"body":"<h1>model\/console<\/h1>\n<p>Writes structured messages to the browser console and answers diagnostic pings.\nImplemented in the wires script.<\/p>\n<h2>post\/log<\/h2>\n<p>Topic: <code>model\/console\/post\/log<\/code>.<\/p>\n<table class=\"table\"><thead><tr><th>Payload field<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><code>message<\/code><\/td><td>Message string.<\/td><\/tr><tr><td><code>severity<\/code><\/td><td>Defaults to <code>info<\/code>; <code>critical<\/code>, <code>fatal<\/code>, and <code>error<\/code> are red, <code>warning<\/code> is orange, and <code>notice<\/code> is blue.<\/td><\/tr><tr><td><code>fields<\/code><\/td><td>Optional object of additional values to log.<\/td><\/tr><tr><td><code>meta<\/code><\/td><td>Optional metadata object; <code>file<\/code> and <code>line<\/code> provide a source location.<\/td><\/tr><\/tbody><\/table>\n<pre class=\"notranslate\"><code class=\"notranslate language-javascript\">cotonic.broker.publish(&quot;model\/console\/post\/log&quot;, {\n    message: &quot;Preview updated&quot;,\n    severity: &quot;info&quot;,\n    fields: { resource_id: 123 }\n});\n<\/code><\/pre>\n<p>This command does not reply. On pages whose HTML element has the\n<code>environment-development<\/code> class, the same handler also subscribes to\n<code>bridge\/origin\/model\/log\/event\/console<\/code> for server log messages.<\/p>\n<h2>post\/ping<\/h2>\n<p>Topic: <code>model\/console\/post\/ping<\/code>.<\/p>\n<p>Replies with the string <code>&quot;pong&quot;<\/code> when the request supplies a response topic. The\nreply uses the request&#39;s QoS.<\/p>\n<pre class=\"notranslate\"><code class=\"notranslate language-javascript\">cotonic.broker.call(&quot;model\/console\/post\/ping&quot;, {}).then(function(msg) {\n    console.log(msg.payload); \/\/ &quot;pong&quot;\n});\n<\/code><\/pre>\n<p>There is no retained <code>model\/console\/event\/ping<\/code> announcement.<\/p>\n<h2>Implementation<\/h2>\n<p><a href=\"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_wires\/priv\/lib\/js\/apps\/zotonic-wired.js\">JavaScript source<\/a>.<\/p>","slug":"model-console","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"57bfbbc5fbb474813c3896fd879683961173e283bb267b4d6d654eaf61334274","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":2723,"is_a":["meta","category"],"name":"cotonic_model","title":"Cotonic models","uri":"https:\/\/zotonic.com\/id\/cotonic_model"},"doc_source_path":"doc\/cotonic-models\/console.md","publication_start":"2026-09-30T09:18:25Z","page_path":"\/cotonic\/zotonic-models\/console","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/doc\/cotonic-models\/console.md","pivot_location_lng":null,"doc_source_kind":"cotonic_model","name":"doc_zotonic_cotonic_model_console","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2026-09-30T09:18:25Z","uri":null,"doc_status":"current","is_dependent":false,"publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"b8c4b2ccdc223257f311968fbd17b2d66f0c4156\n","creator_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"modified":"2026-09-30T09:40:08Z","title_slug":"model-console"},"uri":"https:\/\/zotonic.com\/id\/2751","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2751"}},"status":"ok"}