So, did you understand the concept of a journal ?

S.

Le 26/04/2021 à 16:26, Stéphane Mottelet a écrit :


Le 26/04/2021 à 15:15, Samuel Gougeon a écrit :
Le 26/04/2021 à 14:51, Samuel Gougeon a écrit :
Le 26/04/2021 à 14:15, Stéphane Mottelet a écrit :
.../...

Such a wish was reported 10 years ago as bug 6801 <https://antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/2/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/bugzilla.scilab.org/show_bug.cgi?id=6801>.

To me, the only way to overcome any mprintf or disp made in *.start files of external modules would be to become able to redirect the standard output to null (or anywhere else as in a file, as with diary, that forks the stream instead of redirecting it). I don't think that %toolboxes aims to become public. atomsGetInstalled() and atomsGetLoaded() (and others) would likely be more suited to test the atoms status.

For contribution,
Samuel

Yeah that's the idea. But better than redirection of the standard output, all the stuff displayed in the .start file should go in a Journal, to which display methods can be associated. So instead of explicitely calling disp or mprinf, etc. the .start script should just add some stuff + associated verbosity level to the journal. What would be actually really displayed

Whatever is the method -- redirection of stdout to a file or special diary  --, i am afraid that the analysis of contents vs verbosity would then be done only after completing the whole loading process. This would prevent displaying information in a progressive way : immediately after loading macros, then after loading the documentation, etc... that will anyway be required in some occasion.

A Journal is not a diary, neither a redirection to a file and there is no analysis of content for verbosity of user output. The verbosity is chosen when creating the journal. Here is a small example of what I meant:

function  j=journal(level, fun)
     j  =  mlist(["journal","level","displayfun"],level,fun)
endfunction

function  out=%journal_e(varargin)
     j  =  varargin($);
     level  =  varargin(1);
     if  level  <=  j.level
         j.displayfun(varargin(2:$-1));
     end
     out=[];
endfunction

function  loadmacros(jnl)
jnl(3,"\t Warning library MD5SUM invalid abf4bffa3651a44fdd550e2dbffbe912\n")
     jnl(3,"\t-->Warning, macros are obsolete, rebuild lib please\n")
endfunction

function  loadhelp(jnl)
     jnl(3,"\t-->Help files traduction courtesy of W. Shakespeare\n")
endfunction

function  loaddemos(jnl)
     jnl(3,"\t-->TODO: awesome demo missing\n")
endfunction

function  start(jnl)
     jnl(1,"Start Apifun %s\n","0.4")
     jnl(2,"\tLoad macros\n")
     loadmacros(jnl)
     jnl(2,"\tLoad help\n")
     loadhelp(jnl)
     jnl(2,"\tLoad demos\n")
     loaddemos(jnl)
endfunction

console1  =  journal(1,mprintf);
console2  =  journal(2,mprintf);
console3  =  journal(3,mprintf);

mprintf("\n-----Level 1-----\n\n")
start(console1)

mprintf("\n-----Level 2-----\n\n")
start(console2)

mprintf("\n-----Level 3-----\n\n")
start(console3) -----Level 1----- Start Apifun 0.4 -----Level 2----- Start Apifun 0.4 Load macros Load help Load demos -----Level 3----- Start Apifun 0.4 Load macros Warning library MD5SUM invalid abf4bffa3651a44fdd550e2dbffbe912 --> Warning, macros are obsolete, rebuild lib please Load help --> Help files traduction courtesy of W. Shakespeare Load demos --> TODO: awesome demo missing S.



_______________________________________________
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users
--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
users mailing list
users@lists.scilab.org
https://antispam.utc.fr/proxy/1/c3RlcGhhbmUubW90dGVsZXRAdXRjLmZy/lists.scilab.org/mailman/listinfo/users

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to