eev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What are "logs" for me?


From: Jean Louis
Subject: Re: What are "logs" for me?
Date: Tue, 10 Jan 2023 10:44:14 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Eduardo Ochs <eduardoochs@gmail.com> [2023-01-10 04:30]:
> I've never found ways to do automatic logging that recorded
> everything that I wanted, and I've also never found ways to do
> automatic logging whose output was readable enough... so logging by
> hand - with some tools to help - turned out to be the best solution.

As I study Doug Engelbart, and implement his principles, I would like
to say that it can be made, and it is not too hard, though it requires
paradigm shift:

>From reference:

TECHNOLOGY TEMPLATE PROJECT OHS Framework :
https://www.dougengelbart.org/content/view/110/460/

**** Paradigm Shift Summary

Open Hyperdocument Systems represent a clear departure from prevailing
information system:

| From                                                      | To                
                                                                                
         |
|-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------|
| Tool-centric system                                       | Document-centric 
system                                                                          
          |
| Function-oriented tool system                             | Integrated 
end-to-end knowledge management environment                                     
                |
| Authoring and publishing                                  | Developing, 
integrating and applying knowledge online                                       
               |
| Isolated passive libraries and archives                   | Active "living" 
libraries seamlessly integrated within the organization's work processes        
           |
| One user class: "easy to use"                             | Many classes of 
user: pedestrian to high performance                                            
           |
| File level addressability                                 | Object-level 
addressability                                                                  
              |
| "Load & scroll browsing" in WYSIWYG or outline view modes | "Precision 
browsing" Jumping directly to any object in any file with on-the-fly custom 
views               |
| Windows tied to a file and to the application used        | Windows are 
portals into a file repository; a variety of applications may use any window    
               |
| Each application has unique file design                   | Applications use 
common file design                                                              
          |
| "Interoperability" means font styles retained             | Means my 
structured hyperknowledge interoperates in your environment, I can send you a 
link into my domain |
|-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------|

To make readable and re-executable log one could shift from
tool centric to document centric system.

In simplest example, tool centric system would invoke in file system
the `vlc' player to run video `ABC.mkv'. There would be no special
properties about the video `ABC.mkv', apart from being the file.

In document centric system the video `ABC.mkv' first become one of
"documents", it becomes object with more properties then just a file
in file system with file permissions, such properties are defined and
could be:

- user name who created it

- user name who changed the video

- user names who watched the video, at which time and which date,
  ever?

- list of people related to video

- list of businesses, groups, people lists, related to video

- authors of video

- description of video

- programming functions which may be invoked on video: video editing,
  viewing, renaming, sharing video, and what else

Once all relations are defined, and that goes so fast and is
automated, then comes usage.

Instead of using video players, and command tools directly, user
would use document properties to invoke actions, edit document
properties, related people, etc.

It could be said to be an upgrade to file system. It could be said to
be better and richer file system.

Then, it becomes possible to replay whatever user did with the
"document" `ABC.mkv'.

1. User plays video, that is recorded that user Joe, played video on
   Tue 10 Jan 2023 09:51:24 AM EAT. 

2. User relates Susan to video `ABC.mkv' and describes it why.

3. User tag video.

4. User renames video, remove tags, describes it, change description.

5. User shares video to Johnny.

6. User assigns video task to Mimah.

As all those actions are document centric and not tool centric, it
becomes possible to know what exactly user did, and at what time, and
by invoking which action.

In fact, it becomes possible to replay what user did, and automate the
playback of the full workflow, either one by one, or all at once.

All of the above is already taking place in RCD Notes and Hyperscope
in Emacs, Dynamic Knowledge Repository.

Sometimes I find it useful to "replay" what I did, but mostly in cases
of debugging or creating some problems.

For example, I may send dispatch to the queue e-mail ID 123 to 1539
people in last 2 days, but not yet send the e-mail. Then I review if
e-mails were generated well or not, maybe I note the error:

Instead of:

> Hello Eduardo,

I may see:

> Hello ,

and I correct the programming error, but ask computer to delete all
notices of sending the e-mail in such way, so that computer know that
it has to send e-mails again.

However, in case of team work, collaborative work, which is possible
through Emacs, then I wish to know what user did at what
time. 

With document centric system, any event related to document may be
recorded somewhere. It may be replayed, reviewed, users and their work
valuated.

And it all happens fast, there is no problem in doing so.

I use the concept of "rings", see library `ring'. I do not use the
library but only the concept, as my information is stored in the
database.

And I use concept that every update of any property shall be
recorded. This is easier then newbi can think of it, as if main
function `rcd-db-update-entry' is the underlying function for update
of every property, than that function "log" all the changes to the
document.

And then there is actual log of actions.

1. ring -- remembers which document was visited at all;

2. vc -- version control, remember which property was ever changed

3. log -- remembers anything 

`ring' -- remember documents just as ID numbers 

(length hyperscope-ring) ➜ 46344

(seq-subseq hyperscope-ring 46330) ➜ (124 218 53 29 37656 37632 37277 37276 
37131 37666 37669 37666 37132 37131)

Because "document" knows which user is activating, the `ring'
remembers which document was activated at what time. For example that
I visited the document below to provide reference in this e-mail is
recorded, and it can be recorded specifially that I have yanked it,
including it could be recorded that I have copied it to Eduardo, as
the first e-mail in mail-mode designates his e-mail address. Computer
could ask me also "to which person", if it can't recognize.

                             ID   48244
                   Date created   "2023-01-10 09:38:30.869686"
                  Date modified   nil
                   User created   "maddox"
                  User modified   "maddox"
          Hyperdocument visited   "Technology Template Project OHS Framework as 
Org file"
                    Description   nil
                           UUID   "0f4437db-9b0b-4ab5-bfc8-720941b0eb35"

Thus every "ring" item has reference to visited hyperdocuments.

If I change the name "Technology Template Project OHS Framework as Org
file" to something like ""Technology Template Project", that would
remain recorded as well in the version control `vc'.

Then if I "activate" the WWW hyperlink that can be recorded as
function which was invoked in the `log' table.

It does require little bit different programming.

If user wish to record the visit of document, user must invoke
function like (hyperscope-ring id) below, that records visitation of
document.

(defun my-function (id b c &optional this)
  (hyperscope-ring id)
  (prin1-to-string `(my-function ,id, b, c, this)))

But if user wish to record the function, technique similar to
`prin1-to-string' above shall be used:

(my-function 1 "hello" 2) ➜ "(my-function 1 \"hello\" 2 nil)"

then such string, including description of what happened, may be
recorded to log:

(log (format "%s viewed video %s" user video-name) 
      (prin1-to-string `(view-video ,id, b, c, this)))

That way one would get readable interpretation:

- computer would know that user name "ochs" related to name "Eduardo
  Ochs", it would interpolate and tell in readable language:

  "Eduardo viewed video Documentary about Environment"

- it would have date, time

- it would have references to document viewed

- it would have exact function invoked

- it could even have the duration that video was viewed, was it 3
  seconds, or 45 minutes

Now to apply that knowledge is not hard really, anybody can do
it. Storag may be database, but it may be also simply Emacs Lisp data
as such data is also database.

(setq my-ring nil) ➜ nil
(push 1 my-ring) ➜ (1)
(push 5 my-ring) ➜ (5 1)
(push 10 my-ring) ➜ (10 5 1)

(defun data-to-file (data file)
  "PRIN1 Emacs Lisp DATA to FILE"
  (string-to-file-force (prin1-to-string data) file))

(data-to-file my-ring "~/my.ring") ➜ "~/my.ring"

now file looks like this:

(10 5 1)

and can be loaded back with:

(defun data-from-file (file)
  "Reads and returns Emacs Lisp data from FILE"
  (condition-case nil
      (car (read-from-string
            (file-to-string file)))
    (error nil)))

(setq my-ring-test (data-from-file "~/my.ring")) ➜ (10 5 1)

my-ring-test ➜ (10 5 1)

And "log" of executed notes in eev can as well be recorded, it is just
setting up `M-e' to record the sexp found.

It is well known how to "replace" last sexp:

elisp - In Emacs can you evaluate an Emacs Lisp expression and replace it with 
the result? - Stack Overflow:
https://stackoverflow.com/questions/3035337/in-emacs-can-you-evaluate-an-emacs-lisp-expression-and-replace-it-with-the-resul

  (defun replace-last-sexp ()
    (interactive)
    (let ((value (eval (preceding-sexp))))
      (kill-sexp -1)
      (insert (format "%S" value))))

Thus (preceding-sexp) is the key for M-e to be logged:

(defun my-M-e ()
  (interactive)
  (goto-char (line-end-position))
  (let* ((sexp (preceding-sexp))
         (representation "Eduardo invoked M-e on `%s'")
         (log-function (prin1-to-string sexp)))
  (message representation log-function)
  (ignore)))

(keymap-global-set "M-e" #'my-M-e)

Now everything every invoked with "M-e" get logged:

Eduardo invoked M-e on ‘(keymap-global-set "M-e" #'my-M-e)’

and one can use representation to get it more readable, and the
function to get the action re-playable.

(+ 2 2)
Eduardo invoked M-e on ‘(+ 2 2)’

What else could be remembered?

- file name
- file line position
- preceding buffer
- next buffer
- any file visited at what time by which user

And it may be saved all as Emacs Lisp data in the file. It could be
one file per date or one file per month, or one general file.

And easiest is storing it in the database like PostgreSQL. Building o
SQLite is single user centric, and will not allow collaboration and
principles as given by Doug Engelbart.

--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/








reply via email to

[Prev in Thread] Current Thread [Next in Thread]