new smm functions?

M

Thread Starter

Mario de Sousa

Hello all,

I was thinking of adding the following functions to the 'smm'. They don't really belong to the smm. Maybe create another module? I don't know, but I think the following functionality should be included:

in a possible log.h file?
void plc_log_wrnmsg(char * ...);
void plc_log_errmsg(char * ...);

in smm.h file.
int plc_get_debuglevel(void);

The first two would be used by every module to log warning and error messages in commonly configured files. These messages would be pre-pended automatically with the name of the module
producing the messages.

The third would be used to get the debug level (verbosity) of the messages the module should produce. This could be set on the command line with --PLCdebug=XXX when each module is launched?

Is anybody against this?

--
----------------------------------------------------------------------------
Mario J. R. de Sousa [email protected]
----------------------------------------------------------------------------



_______________________________________________
LinuxPLC mailing list
[email protected]c.org
http://linuxplc.org/mailman/listinfo/linuxplc
 
Mario de Sousa wrote:

>I was thinking of adding the following functions to the 'smm'.
>They don't really belong to the smm. Maybe create another
>module? I don't know, but I think the following functionality
>should be included:
>
>in a possible log.h file?
>void plc_log_wrnmsg(char * ...);
>void plc_log_errmsg(char * ...);

Sounds like a good idea... (probably in a separate file, though).

>in smm.h file.
>int plc_get_debuglevel(void);

This should probably go in the config file (maybe in the [PLC] section).

But it does make sense to have utility functions that retrieve an integer or whatever (with defaults), to make using the conffile library easier. (I didn't get time to write that before going off...)

Hmm, there should probably be a command-line option to use an alternate config file, but there's no hurry for that.

Jiri <[email protected]>


_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
Top