@whook/whook
Version:
Build strong and efficient REST web services.
30 lines (27 loc) • 697 B
text/typescript
import { type Logger } from 'common-services';
import { service, location } from 'knifecycle';
import debug from 'debug';
import { info, error } from 'node:console';
/* Architecture Note #2.7.1: Logging
Whook's default logger write to the NodeJS default console
except for debugging messages where it uses the `debug`
module so that you can set the `DEBUG` environment
variable to `whook` and get debug messages in output:
```sh
DEBUG=whook npx whook
```
*/
export default location(
service(
async () =>
({
output: info,
error: error,
debug: debug('whook'),
}) as Logger,
'logger',
[],
true,
),
import.meta.url,
);