fixes to support composer / packagist
This commit is contained in:
@ -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 );
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user