@technote-space/github-action-log-helper
v0.2.19
Published
Logging helpers for GitHub Actions.
Downloads
218
Readme
Github Action Log Helper
Read this in other languages: English, 日本語.
GitHub Actions 用のログヘルパー
Table of Contents
インストール
yarn
yarn add @technote-space/github-action-log-helper
npm
npm i @technote-space/github-action-log-helper
Logger
import { Logger } from '@technote-space/github-action-log-helper';
const logger = new Logger();
logger.startProcess('Process name');
logger.displayCommand('command');
logger.displayStdout('stdout1\nstdout2');
logger.displayStderr('stderr1\nstderr2');
logger.log();
logger.info('output info');
logger.endProcess();
// ::group::Process name
// [command]command
// >> stdout1
// >> stdout2
// ::warning:: >> stderr1
// ::warning:: >> stderr2
//
// > output info
// ::endgroup::
logger.getColorString('colored text', 'green'); // Color: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white'
logger.getColorString('colored text', 'yellow', 'underline'); // Attribute: 'bold' | 'underline' | 'italic'
logger.c('colored text', 'yellow', 'underline'); // alias