INSERT INTO `wStats` (`Date`,`UID`,`URL`,`ARGS`,`IP`,`Referer`) VALUES ("2010-09-10 11:49","1284130208-8785090","docs.mioplanet.com/log.php","","38.107.191.115","") log | MioScript | MioFactory | Mioplanet Documentation Center
  Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | MioScript | log SEARCH    

  Functions
alert
log
system.battery.ACLineStatus
system.battery.LifePercent
system.beep
system.clipboard.clear
system.clipboard.get.format
system.clipboard.get.image
system.clipboard.get.text
system.clipboard.set.image
system.clipboard.set.text
system.createUniqueId
system.dialog
system.doEvents
system.execute
system.explore
system.getColors
system.getComputerId
system.getComputerName
system.getMemoryInfo
system.getUserName
system.ignoreCriticalErrors
system.language
system.lastError
system.logIsEnabled
system.message
system.mioEngine.countInstances
system.mioEngine.filename
system.mioEngine.version
system.openURL
system.os
system.platform
system.priority
system.process.create
system.process.free
system.process.getExitCode
system.userIsAdmin
system.winapi.errorMsg
system.winapi.lastError
system._hidden
system._showInTaskBar

  Events
event.error
event.exception
event.memoryFull
event.screen:resolution:change
event.system:desktop:changed
event.system:display:changed

  MioScript Reference
> Statements
app...
browser...
dialog...
disk...
draw...
extern...
filename...
keyboard...
menu...
mio...
mouse...
num...
path...
pushButton...
reg...
RS232...
sci...
screen...
shortcut...
sound...
str...
system...
time...
var...
window...

Function
log

Language: MioScript
Product: MioFactory


Syntax

log(typeOrText, Text)


Parameters

STRINGtypeOrTextType of entry. Can a text (with HTML support), or one of the following values:
EMPTY: Empty line.
INFO: Text to be displayed one time and replaced by the next entry.
ERROR: Shows an error, in red.
WARNING: Shows a warning.
TITLE: Title, to make the log easier to read.
SUBTITLE: Sub-title.
STRINGTextOptional.
Text to be added in the log file.
.HTML is supported.


Return value

No value is returned.


Description

Adds an entry in the log file (log.htm) when log is enabled.

Log can be enabled or disabled from MioFactory, and the log file can be viewed from MioFactory or with any web browser.
The function system.logIsEnabled returns true if log is enabled.

If the application is installed on the computer, the log file is saved in the application install folder with the name.
Otherwise, the log file is created in a temporary folder.

The path to the log file can be retrieved with path.log.

Warning: Do not enable the log except if your application is being tested for bug tracking.
The log uses CPU and the application runs slower.

The log file can be updated from JavaScript with the function log.

Note: This function is defined in the library klib.k and is linked automatically.




MioScript Sample Code

log("TITLE", "Hello, World")
log("SUBTITLE", "Hello, World")
log("ERROR", "This is an error")
log("EMPTY") // Blank line
log("INFO", "Text erased when a new entry is added in the log.")
log("This is a text to be added in the log.")