Returns the natural logarithm of a number. For an ErrorLogging object, this function can be used to write a string to the log file maintained by the object’s container.
To |
Use |
---|---|
Determine the natural logarithm of a number |
|
Write a string to a log file |
Determines the natural logarithm of a number.
Log ( n )
Argument |
Description |
---|---|
n |
The number for which you want the natural logarithm (base e). The value of n must be greater than 0. |
Double. Returns the natural logarithm of n. An execution error occurs if n is negative or zero. If n is null, Log returns null.
This statement returns 2.302585092:
Log(10)
This statement returns –.693147. . . :
Log(0.5)
Both these statements result in an error at runtime:
Log(0)
Log(-2)
After the following statements execute, the value of a is 200:
double a, b = Log(200)
a = Exp(b)// a = 200
Writes a string to the log file maintained by the object’s container.
ErrorLogging objects
errorlogobj.Log ( message )
Argument |
Description |
---|---|
errorlogobj |
Reference to the ErrorLogging service instance |
message |
The text string you want to write to the log |
None.
The ErrorLogging object provides the ability to write messages to the log file used by the object’s container, such as jaguar.log for EAServer.
Before you call the Log function, create an instance of the ErrorLogging service by calling the GetContextService function.
The following example shows how to write a string to the log for EAServer or COM+:
ErrorLogging el
this.GetContextService("ErrorLogging", el)
el.log("Write this string to log")