fixes to support composer / packagist

This commit is contained in:
Joey Kimsey
2024-08-08 01:18:19 -04:00
parent 0627207452
commit bfe714b179
6 changed files with 67 additions and 18 deletions

View File

@ -6,7 +6,6 @@
* @author Joey Kimsey <Joey@thetempusproject.com>
*/
namespace TheTempusProject\Canary\Classes;
use TheTempusProject\Bedrock\Functions\Date;
class Logger {
public $file;
@ -97,12 +96,24 @@ class Logger {
}
private function timestamp() {
$dateString = Date::getReadableDate( time() );
$dateString = self::getReadableDate( time() );
return '['.$dateString.'] - ';
}
private function typestamp( $type ) {
$dateString = Date::getReadableDate( time() );
$dateString = self::getReadableDate( time() );
return '[' . strtoupper( $type ) . '] - ';
}
public static function getReadableDate( $timestamp, $with_timezone = false ) {
if ( $with_timezone ) {
$date = new \DateTime();
$date->setTimestamp( $timestamp );
$timezone = new \DateTimeZone( self::getTimezone() );
$date->setTimezone( $timezone );
$formattedDate = $date->format('Y-m-d H:i:s');
return $formattedDate;
}
return date( 'Y-m-d H:i:s', $timestamp );
}
}