ActivityPub Viewer

A small tool to view real-world ActivityPub objects as JSON! Enter a URL or username from Mastodon or a similar service below, and we'll send a request with the right Accept header to the server to view the underlying object.

Open in browser →
{ "id": "https://discourse.osgeo.org/ap/collection/4ff1acfc023ccc8bb897d21597c4193a", "type": "OrderedCollection", "audience": "https://discourse.osgeo.org/ap/actor/e12a97a00c04f88ba48156f05cd55220", "to": "https://discourse.osgeo.org/ap/actor/e12a97a00c04f88ba48156f05cd55220", "cc": "https://www.w3.org/ns/activitystreams#Public", "updated": "2024-09-27T09:06:11Z", "url": "https://discourse.osgeo.org/t/how-to-add-log-messages-in-pgrouting-code/59991", "name": "How to add log messages in PgRouting code?", "totalItems": 2, "orderedItems": [ { "id": "https://discourse.osgeo.org/ap/object/10f99cbfc16d0557b86cab73d2cdc780", "type": "Note", "audience": "https://discourse.osgeo.org/ap/actor/e12a97a00c04f88ba48156f05cd55220", "to": "https://discourse.osgeo.org/ap/actor/e12a97a00c04f88ba48156f05cd55220", "cc": [ "https://www.w3.org/ns/activitystreams#Public" ], "published": "2024-09-27T21:59:21Z", "updated": "2024-09-27T21:59:21Z", "url": "https://discourse.osgeo.org/t/how-to-add-log-messages-in-pgrouting-code/59991/2", "attributedTo": "https://discourse.osgeo.org/ap/actor/698c8043a23f42700545ea9c7bd6f21a", "context": "https://discourse.osgeo.org/ap/collection/4ff1acfc023ccc8bb897d21597c4193a", "content": "<p>HiNot that simple but ....</p><p><strong>NOTE</strong>All these links are done for this branch at sept 27, 2024. They might be outdated, in the future but they will look to v3.7.0 soon to be released.</p><p><a href=\"https://github.com/pgRouting/pgrouting/blob/develop\">https://github.com/pgRouting/pgrouting/blob/develop</a></p><p>This <a href=\"https://github.com/pgRouting/pgrouting/blob/develop/include/withPoints/pgr_withPoints.hpp#L40\">line</a> will add to the class the following <a href=\"https://github.com/pgRouting/pgrouting/blob/develop/include/cpp_common/pgr_messages.hpp#L78\">class members</a> then it can be used like in this <a href=\"https://github.com/pgRouting/pgrouting/blob/develop/src/withPoints/pgr_withPoints.cpp#L113\">code</a>.</p><p>To be able to see the messages when executing a query:</p><p><a href=\"https://github.com/pgRouting/pgrouting/blob/develop/src/withPoints/withPoints_driver.cpp#L105\">A place to save the log on C++ code</a></p><pre><code class=\"lang-auto\">std::ostringstream log;</code></pre><p><a href=\"https://github.com/pgRouting/pgrouting/blob/develop/src/withPoints/withPoints_driver.cpp#L155\">Get the log</a></p><pre><code class=\"lang-auto\">log &lt;&lt; pg_graph.get_log();</code></pre><p><a href=\"https://github.com/pgRouting/pgrouting/blob/develop/src/withPoints/withPoints_driver.cpp#L157\">Create the C string using postgres memopry handling</a></p><pre><code class=\"lang-auto\">*log_msg = pgr_msg(log.str().c_str());</code></pre><p>And on postgresSQL: (note in this example from the documentation the query does not have error so nothing gets logged except the time it took to read the data)</p><pre><code class=\"lang-auto\">SET client_min_messages TO DEBUG3;SETsampledata=# SELECT * FROM pgr_withPoints( 'SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id', 'SELECT pid, edge_id, fraction, side from pointsOfInterest', -1, 10, details =&gt; true);DEBUG: Elapsed time for processing pgr_withPoints: 0.000709 sec = (18277.000000 - 17568.000000) / CLOCKS_PER_SEC</code></pre><p>Hope this helpsVicky</p><br><br><a href=\"https://discourse.osgeo.org/t/how-to-add-log-messages-in-pgrouting-code/59991/2\">Discuss this on our forum.</a>", "inReplyTo": "https://discourse.osgeo.org/ap/object/7b15d4894c7ab8639339edfe8480c2cf", "@context": "https://www.w3.org/ns/activitystreams" }, { "id": "https://discourse.osgeo.org/ap/object/7b15d4894c7ab8639339edfe8480c2cf", "type": "Note", "audience": "https://discourse.osgeo.org/ap/actor/e12a97a00c04f88ba48156f05cd55220", "to": "https://discourse.osgeo.org/ap/actor/e12a97a00c04f88ba48156f05cd55220", "cc": [ "https://www.w3.org/ns/activitystreams#Public" ], "published": "2024-09-27T09:11:14Z", "updated": "2024-09-27T09:11:14Z", "url": "https://discourse.osgeo.org/t/how-to-add-log-messages-in-pgrouting-code/59991/1", "attributedTo": "https://discourse.osgeo.org/ap/actor/e932b6928eef643199fc6ea98883e072", "name": "How to add log messages in PgRouting code?", "context": "https://discourse.osgeo.org/ap/collection/4ff1acfc023ccc8bb897d21597c4193a", "content": "<p>I would like to know which is the best way to have log messages from inside C++ / C parts of the code ?</p><p>I have seen functions such as pgr_notice() or pgr_error() but I think they are note used in the code for now. Is it the way it should be done? For other ways of logging, it is not clear for me which one is adapted to which context.</p><p>For the context, I try to enrich the already existing \"contractions\" module.</p><br><br><a href=\"https://discourse.osgeo.org/t/how-to-add-log-messages-in-pgrouting-code/59991/1\">Discuss this on our forum.</a>", "@context": "https://www.w3.org/ns/activitystreams" } ], "@context": "https://www.w3.org/ns/activitystreams" }