Difference between revisions of "Program Examples:sys log"

From SoftMC-Wiki
Jump to: navigation, search
(Created page with "'sys.log' is a Linux logger that allows the programmer to document strings while his program is running. We've enabled this feature in MC-Basic context as well. ==Printing sy...")
 
Line 9: Line 9:
 
-bash-3.2$ cat /var/sys.log
 
-bash-3.2$ cat /var/sys.log
 
</pre>
 
</pre>
or
+
or<br/>
 
3. To print the last few lines, type in the Linux terminal:
 
3. To print the last few lines, type in the Linux terminal:
 
<pre>
 
<pre>
Line 17: Line 17:
  
 
==Sending strings to sys.log==
 
==Sending strings to sys.log==
 +
Globally load the MC library SYSLOG.LIB.
 +
Invoke the function<br/>
 +
MC_BASIC_SYS_LOG(MC_BASIC_LOG_MODULE, debug_level, log_str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)

Revision as of 08:35, 31 December 2014

'sys.log' is a Linux logger that allows the programmer to document strings while his program is running. We've enabled this feature in MC-Basic context as well.

Printing sys.log

To print sys.log do the following: 1. Connect to the softMC using ssh or serial console.
2. To print the entire log, type in the Linux terminal:

-bash-3.2$ cat /var/sys.log

or
3. To print the last few lines, type in the Linux terminal:

-bash-3.2$ tail -50 /var/sys.log

where '50' is the number of lines that will be printed from the end of the file.

Sending strings to sys.log

Globally load the MC library SYSLOG.LIB. Invoke the function
MC_BASIC_SYS_LOG(MC_BASIC_LOG_MODULE, debug_level, log_str, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10)