Updated Logger.

> Changed maintaining of phase information
> Cleaned up code.