HHVM 4.95 and above.
usenamespace HackLogging;usenamespace HH\Lib\IO;asyncfunctionfvAsync():Awaitable<void> {list($read,$write)=IO\pipe();$log=newHackLogging\Logger('hack-logging',vec[newHackLogging\Handler\StdHandler($write), ]);await$log->writeAsync(HackLogging\LogLevel::DEBUG,'hacklogging-test', );}
usenamespace HackLogging;usenamespace HH\Lib\File;usefunction bin2hey();usefunction random_bytes;usefunction sys_get_temp_dir;asyncfunctionfvAsync():Awaitable<void> {$filename=sys_get_temp_dir().'/'.bin2hex(random_bytes(16));$file=File\open_write_only($filename);$log=newHackLogging\Logger('hack-logging',vec[newHackLogging\Handler\FilesystemHandler($file), ]);await$log->writeAsync(HackLogging\LogLevel::DEBUG,'hacklogging-test',dict['context'=>vec['nice'], ], );}