added 'write' method for backward сompatibility
added log method