log(x, base=None)
Return the logarithm of x to the given base.
 
Calls the ``log`` method of the object x when computing
the logarithm, thus allowing use of logarithm on any object
containing a ``log`` method. In other words, log works
on more than just real numbers.
 
TODO: Add p-adic log example.
 
EXAMPLES::
 
    sage: log(e^2)
    2 
    sage: log(1024, 2); RDF(log(1024, 2))
    10
    10.0
    sage: log(10, 4); RDF(log(10, 4))
    log(10)/log(4)
    1.66096404744
 
::
 
    sage: log(10, 2)
    log(10)/log(2)
    sage: n(log(10, 2))
    3.32192809488736
    sage: log(10, e)
    log(10)
    sage: n(log(10, e))
    2.30258509299405
 
The log function also works in finite fields as long as the base is
generator of the multiplicative group::
 
    sage: F = GF(13); g = F.multiplicative_generator(); g
    2
    sage: a = F(8)
    sage: log(a,g); g^log(a,g)
    3
    8
    sage: log(a,3)
    Traceback (most recent call last):
    ...
    ValueError: base (=3) for discrete log must generate multiplicative group