Skip to content

Commit

Permalink
Merge pull request #68 from alleyinteractive/enhance
Browse files Browse the repository at this point in the history
Release 2.2.0
  • Loading branch information
srtfisher authored Sep 2, 2022
2 parents b48cf63 + 3d9346f commit 4d3e668
Show file tree
Hide file tree
Showing 20 changed files with 559 additions and 794 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,15 @@ updates:
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "saturday"
time: "09:00"
timezone: "America/New_York"
ignore:
- dependency-name: "@wordpress/*"
labels:
- "dependabot"
44 changes: 0 additions & 44 deletions .github/workflows/build.yml

This file was deleted.

10 changes: 10 additions & 0 deletions .github/workflows/built-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Create a -built branch

on:
push:
branches:
- main

jobs:
built-branch:
uses: alleyinteractive/.github/.github/workflows/built-branch.yml@main
11 changes: 11 additions & 0 deletions .github/workflows/built-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Create a -built tag

on:
push:
tags:
- 'v*.*.*'
- '!*-built'

jobs:
built-tag:
uses: alleyinteractive/.github/.github/workflows/built-tag.yml@main
42 changes: 2 additions & 40 deletions .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,5 @@ on:
- cron: '0 0 * * *'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
php: [8.0]
name: PHP ${{ matrix.php }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Set up Composer caching
uses: actions/cache@v3
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ matrix.php }}-composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
tools: composer:v2
coverage: none
- name: Validate Composer
run: composer validate --strict
- name: Install dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer install
- name: Run phpcs
run: composer run phpcs
coding-standards:
uses: alleyinteractive/.github/.github/workflows/php-coding-standards.yml@main
47 changes: 0 additions & 47 deletions .github/workflows/release-tag.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/release.yml

This file was deleted.

84 changes: 6 additions & 78 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,84 +9,12 @@ on:
- cron: '0 0 * * *'

jobs:
tests:
runs-on: ubuntu-latest

services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
redis:
image: redis:5.0
ports:
- 6379:6379
options: --entrypoint redis-server
continue-on-error: ${{ matrix.can_fail }}
php-tests:
strategy:
fail-fast: true
matrix:
php: [7.4, 8.0]
wp_version: ["latest"]
can_fail: [false]

name: PHP ${{ matrix.php }} -- ${{ matrix.wp_version }}
env:
CACHEDIR: /tmp/test-cache
WP_CORE_DIR: /tmp/wordpress
WP_VERSION: ${{ matrix.wp_version }}
WP_DB_HOST: 127.0.0.1
WP_DB_USER: root
WP_DB_PASSWORD: '""'

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/cancel-workflow-action@0.10.0
with:
access_token: ${{ github.token }}

- name: Checkout code
uses: actions/checkout@v3

- name: Get Composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Set up Composer caching
uses: actions/cache@v3
env:
cache-name: cache-composer-dependencies
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd
tools: composer:v2
coverage: none

- name: Setup Memcached
uses: niden/actions-memcached@v7

- name: Validate Composer
run: composer validate --strict

- name: Install dependencies
uses: nick-invision/retry@v2
with:
timeout_minutes: 5
max_attempts: 5
command: composer install

- name: Test Package
shell: bash
run: composer run phpunit
wordpress: ["latest"]
uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main
with:
php: ${{ matrix.php }}
wordpress: ${{ matrix.wordpress }}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ CHANGELOG](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## 2.2.0

- Dependency bumps.

## 2.1.0

### Added
Expand Down
62 changes: 55 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ Suite](https://github.com/alleyinteractive/logger/workflows/Testing%20Suite/badg
Providing a WordPress integration with Monolog, allowing site-wide and post and
term specific logging.

## Documentation

See the [wiki](https://github.com/alleyinteractive/logger/wiki).
<img width="1018" alt="Screen Shot 2020-05-14 at 4 13 47 PM" src="https://user-images.githubusercontent.com/346399/81981285-197bd880-95fe-11ea-8645-1bb0fa3569a8.png">

```php
ai_logger()->info( 'Log message...' );
## Documentation

\AI_Logger\AI_Logger::info( 'Another format for logging.' );
```
See the [wiki](https://github.com/alleyinteractive/logger/wiki) for complete information and more examples.

## Installation

Expand All @@ -27,3 +23,55 @@ composer install

You can use it as a submodule in your project by loading the `main-built`
branch.


## Usage

AI Logger is a complete interface to Monolog with some nice WordPress handlers built in.

```php
// Log site-wide to the ai_log post type.
ai_logger()->info( 'Log message...' );

\AI_Logger\AI_Logger::info( 'Another format for logging.' );
```

### Logging to a Specific Post

Logs will be appended to a post's meta for review.

```php
ai_logger_to_post( $post_id, 'meta-key' )->info( 'This will log to the <meta-key> for a specific post.' );
```

### Logging to a Specific Term

Logs will be appended to a term's meta for review.

```php
ai_logger_to_term( $term_id, 'meta-key' )->info( 'This will log to the <meta-key> for a specific term.' );
```

### Logging to Query Monitor

```php
ai_logger_to_qm()->info( 'This will show up in Query Monitor!' );
```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed
recently.

## Maintainers

This project is actively maintained by [Alley
Interactive](https://github.com/alleyinteractive). Like what you see? [Come work
with us](https://alley.co/careers/).

![Alley logo](https://avatars.githubusercontent.com/u/1733454?s=200&v=4)

## License

This software is released under the terms of the GNU General Public License
version 2 or any later version.
Loading

0 comments on commit 4d3e668

Please sign in to comment.