Contextlog implementation

No, just the code is written in a function.