1 Commits
1.0.4 ... 1.0

Author SHA1 Message Date
8f140bee75 renaming for composer 2024-08-09 04:08:24 +00:00
5 changed files with 3 additions and 31 deletions

View File

@ -17,7 +17,6 @@ namespace TheTempusProject\Canary\Bin;
use TheTempusProject\Canary\Classes\TempusDebugger;
use TheTempusProject\Canary\Classes\Logger;
use Exception;
class Canary {
private static $lastCall = '';
@ -226,8 +225,8 @@ class Canary {
if ( ! CANARY_ENABLED ) {
return;
}
if ( strlen( self::$debugLog ) > CANARY_DEBUG_LOG_LIMIT ) {
self::$tempusLogger->addLog( 'log', 'Error log too large, possible loop.' );
if ( strlen( self::$debugLog ) > 50000 ) {
self::$tempusDebugger->log( 'Error log too large, possible loop.' );
return;
}
if ( is_object( $data ) ) {

View File

@ -17,7 +17,6 @@ class Logger {
$this->file = fopen( $this->logFilePath, 'a' );
fwrite( $this->file, '===================------++++++++++------===================' . PHP_EOL );
}
public function setupLogFile() {
$this->logDirectory = rtrim( CANARY_DEBUG_DIRECTORY, DIRECTORY_SEPARATOR );
if ( ! is_dir( $this->logDirectory ) ) {
@ -32,13 +31,12 @@ class Logger {
chmod( $this->logFilePath, 0777 );
}
}
public function __destruct() {
fwrite( $this->file, '============================================================' . PHP_EOL );
fclose( $this->file );
}
public function addLog( $type = 'log', $log = '' ) {
public function addLog( $type = 'log', $log ) {
switch ( CANARY_DEBUG_TO_FILE_LEVEL ) {
case CANARY_DEBUG_LEVEL_ERROR:
$acceptableLoggingLevels = [

View File

@ -48,9 +48,6 @@ if ( ! defined( 'CANARY_SHOW_LINES' ) ) {
if ( ! defined('CANARY_DEBUG_TO_CONSOLE' ) ) {
define( 'CANARY_DEBUG_TO_CONSOLE', false );
}
if ( ! defined('CANARY_DEBUG_LOG_LIMIT' ) ) {
define( 'CANARY_DEBUG_LOG_LIMIT', 500000 );
}
# Tell the app all constants have been loaded.
if ( ! defined('CANARY_CONSTANTS_LOADED' ) ) {

20
composer.lock generated
View File

@ -1,20 +0,0 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "2766960a50e2f2f76a8ec41e644bc0de",
"packages": [],
"packages-dev": [],
"aliases": [],
"minimum-stability": "dev",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=8.1.0"
},
"platform-dev": [],
"plugin-api-version": "2.3.0"
}

2
logs/.gitignore vendored
View File

@ -1,2 +0,0 @@
*
!.gitignore