Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Send logs to files For HHVM/Hack

License

NotificationsYou must be signed in to change notification settings

ytake/hack-logging

Repository files navigation

Build Status

Requirements

HHVM 4.95 and above.

Usage

$ composer require hack-logging/hack-logging

StdHandler

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',  );}

FilesystemHandler

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'],    ],  );}

[8]ページ先頭

©2009-2025 Movatter.jp