nimLog is all method from Perl SDK API that allow to create and manage a log file for your probe.
# Your log (file) name
my $LOGFILE = "probe.log";
# Open the nimLog handle
nimLogSet($LOGFILE, "", 5, NIM_LOGF_NOTRUNC);
# Truncate the log file size to 512KB
nimLogTruncateSize(512 * 1024);
nimLog(3,"Hello world!");
# Set the log level to 2
nimLogSetLevel(2);
nimLog(3,"Hello world!"); # Skipped
# Close current log
nimLogClose()
Create log utility. (Like a class constructor).
Flags |
---|
NIM_LOGF_NOTRUNC |
NIM_LOGF_RESETATSTART |
Close a log handle.
Log a message in the current nimLog handler (defined with nimLogSet);
Set a new log-level
Launch a new truncate of the file (can be defined with nimLogTruncateSize
OR nimLogTruncateTime
method).
nimLogTruncateSize(512 * 1024);
sleep(10);
nimLogTruncate(); # Run 512 KB truncate!
Truncate logsize (in KB). So it's base * 1024. (For example 512KB is 512*1024).
nimLogTruncateSize(512 * 1024);
Warn: Truncate only support one method (time or size) at the same time.
Truncate the logfile based on time. Time is in seconds
.
nimLogTruncateTime(60 * 10); # 10 minutes.
Warn: Truncate only support one method (time or size) at the same time.
Dump a PDS object to the log.
Close the log.