ilog: Echo a copy of console to log file

Description Usage Arguments Details Author(s) Examples

View source: R/ilog.R

Description

ilog() echo a copy of console output to log file.

Usage

1
2
3
4
5
6
7
ilog(logfile = "LOG.txt", append = FALSE)

ilog.close()

ilogtxt(cmd, res, s, vis)

ilogClearPrompt()

Arguments

logfile

Name of desired log file in .txt format

append

a logical value

cmd

command line

res

result

s

others

vis

others

Details

ilog is a two-step function that allows you a record of your console. A log is a file containing what you type and console output. If a name is not specified, then ilog will use the name <unnamed>.txt.

ilog opens a log file and ilog.close close the file.

Warnings:

However, clearing objects from the workspace along with hidden objects removes ilog's .logenv environment, hence throwing an error when it's attemptted to be closed. An error message Error in (function (cmd, res, s, vis) : object '.logenv' not found will be thrown.

In that case, console prompt is stuck at log> . If this error occurs, use ilogClearPrompt() function to revert back to normal.

Author(s)

For any feedback, please contact Myo Minn Oo via:

Email: dr.myominnoo@gmail.com

Website: https://myominnoo.github.io/

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
## my first log
ilog("../myFirstLog.tx")
str(infert)
str(iris)
ilog.close()

# in case of error: ".logenv" not found
ilogClearPrompt()

## End(Not run)

myominnoo/mStatsLite documentation built on May 1, 2020, 11:41 a.m.