Learn R Programming

phylosim (version 3.0.5)

Log.PhyloSim: Save a message in the PhyloSim log file

Description

Save a message in the PhyloSim log file.

The message is written to the log file only if the log level is non-negative. You can use this method for logging in the case you write classes for PhyloSim.

Usage

# S3 method for PhyloSim
Log(this, message, ...)

Arguments

this

A PhyloSim object.

message

A character vector of length one.

...

Not used.

Value

The message (invisible).

See Also

For more information see PhyloSim.

Examples

Run this code
# NOT RUN {
	# create a PhyloSim object,
	# with logLevel set to zero
	sim<-PhyloSim(log.level=0);
	# log a message
	Log(sim,"Hiya there!");
	# close log connection
	close(sim$.log.connection)
	# print out the log file
	cat(paste(scan(file=sim$LogFile,what=character(),sep="\n"),collapse="\n"));cat("\n");
	# clean up
	unlink(sim$logFile)
 
# }

Run the code above in your browser using DataLab