Skip to content

Technical Researcher Guide

Flynn Duniho edited this page May 29, 2024 · 1 revision

Caution

AUDIENCE: This is ONLY intended for researchers who are comfortable with making code changes. A bad log entry can break the application.

Important

PREREQUISITE: You need to know how to work with the git repo and compile and build the Net.Create app.


Researcher Logging

Net.Create has a built in logging system to make it easy to generate dribble log files. An experienced coder should be able to add logs to specific events.

The WriteRLog command will log objects in a comma-delimited format, in order. Date/time, project name, network id , and group name are automatically inserted. For example:

2024/05/02	12:52:39	focus	UADDR_11	FOCUS-B-LPJ	select node	8	e
2024/05/02	12:52:45	focus	UADDR_10	-	SRV_NET  -	pong not received before time ran out -- CLIENT CONNECTION DEAD!
2024/05/02	12:53:20	focus	UADDR_11	FOCUS-B-LPJ	update comment	158	{"collection_ref":"n8","comment_id":158,"comment_id_parent":"","comment_id_previous":157,"comment_type":"demo","comment_createtime":"2024-04-27T15:49:09.041Z","comment_modifytime":1714679600835,"commenter_id":"FOCUS-B-LPJ","commenter_text":["abc a little","🤔 A little","Apple\nOrange\nBanana","I disagree","3","2"]}

A general use guide:

  1. Add the UNISYS module:
const UNISYS = require('unisys/client');
  1. Use UNISYS.Log() to log events.
UNISYS.Log( ...args );

for example:

UNISYS.Log('select node', node.id, node.label);

Note that the column order is arbitrary, so it's up to you to determine a consistent log order. e.g. if you wanted matching node and edge events you would do something like this:

UNISYS.Log('select node', node.id, node.label);
...
UNISYS.Log('select edge', edge.id, `${edge.source.label}->${edge.target.label}`);

Clone this wiki locally