-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from nguyenanhung/develop
Develop
- Loading branch information
Showing
9 changed files
with
54 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# GitHub Action for HungNG My Debug | ||
name: Testing HungNG My Debug | ||
on: [ push, pull_request ] | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
operating-system: [ ubuntu-latest, windows-latest, macos-latest ] | ||
php-versions: [ '7.1', '7.4', '8.0' ] | ||
runs-on: ${{ matrix.operating-system }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup PHP, with composer and extensions | ||
uses: shivammathur/setup-php@v2 # From https://github.com/shivammathur/setup-php | ||
with: | ||
php-version: ${{ matrix.php-versions }} | ||
extensions: mbstring, intl, curl, dom, pdo, json, session, sockets, openssl | ||
coverage: xdebug #optional | ||
- name: Get composer cache directory | ||
id: composercache | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
- name: Cache composer dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.composercache.outputs.dir }} | ||
# Use composer.json for key, if composer.lock is not committed. | ||
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: ${{ runner.os }}-composer- | ||
- name: Install dependencies | ||
run: composer install --no-progress --prefer-dist --optimize-autoloader | ||
- name: Test class Logger | ||
run: php ./test/test_logger.php | ||
- name: Test class Utils | ||
run: php ./test/test_utils.php | ||
- name: Test class Benchmark | ||
run: php ./test/test_benchmark.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
/** | ||
* Function dump | ||
* | ||
* @param string $str | ||
* @param mixed $str | ||
* | ||
* @author : 713uk13m <[email protected]> | ||
* @copyright: 713uk13m <[email protected]> | ||
|
@@ -32,7 +32,7 @@ function dump($str = '') | |
* @copyright: 713uk13m <[email protected]> | ||
* @time : 08/17/2021 54:17 | ||
*/ | ||
function testLogPath() | ||
function testLogPath(): string | ||
{ | ||
return __DIR__ . '/../storage/logs/'; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,4 @@ | |
|
||
$path = testLogPath(); | ||
|
||
dump($file->scanAndZip($path, 3)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,14 @@ | |
$name = 'Test'; | ||
$msg = 'Test Log lan 2'; | ||
$context = [ | ||
'name' => 'Nguyen An Hung', | ||
'email' => '[email protected]' | ||
'name' => 'Nguyen An Hung', | ||
'email' => '[email protected]', | ||
'website' => 'https://nguyenanhung.com', | ||
]; | ||
// Call | ||
$logger = new Logger(); | ||
$logger->setDebugStatus(true); | ||
$logger->setGlobalLoggerLevel(null); | ||
$logger->setGlobalLoggerLevel(); | ||
$logger->setLoggerPath($logPath); | ||
$logger->setLoggerSubPath($logSubPath); | ||
$logger->setLoggerFilename($logFilename); | ||
|