Compare commits

...

7 commits

Author SHA1 Message Date
27681d53da
Update CHANGELOG.md for version 1.0.3 and modify project.json to reflect new version and updated dependency source
Some checks are pending
CI / release (push) Waiting to run
CI / debug (push) Waiting to run
CI / check-phpunit (push) Waiting to run
CI / check-phpdoc (push) Waiting to run
CI / generate-phpdoc (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / release-documentation (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
2025-03-14 14:07:49 -04:00
02042dcb39
Updated README.md 2025-03-11 14:14:01 -04:00
netkas
418353b579 ExceptionDetails now accepts a string as a type for the $line and $code parameter, this will automatically
convert the string to an integer.
2025-01-27 03:21:02 -05:00
netkas
61be8c6d73 ExceptionDetails now accepts a string as a type for the $line parameter, this will automatically convert the string to an integer. 2025-01-27 03:11:53 -05:00
netkas
625432e088 Bumped version to 1.0.2 2025-01-27 03:05:28 -05:00
netkas
aad666ee29 Bumped version to 1.0.1 2025-01-22 13:53:47 -05:00
netkas
4848eee708 Fixed issue where \LogLib2\Classes\Utilities::getSafeValue(mixed $input) would return a null value when the typed output is string by including a branch that converts the gettype($input) to a string when the input is null. 2025-01-22 13:53:32 -05:00
5 changed files with 59 additions and 6 deletions

View file

@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.0.3] - 2025-03-14
Minor changes to the project
### Changed
- Updated dependency remote address
## [1.0.2] - 2025-01-27
Minor changes to the project
### Changed
- ExceptionDetails now accepts a string as a type for the $line and $code parameter, this will automatically
convert the string to an integer.
## [1.0.1] - 2025-01-22
Minor changes to the project
### Fixed
- Fixed issue where \LogLib2\Classes\Utilities::getSafeValue(mixed $input) would return
a null value when the typed output is `string` by including a branch that converts
the `gettype($input)` to a string when the input is null.
## [1.0.0] - 2025-01-22

View file

@ -23,10 +23,25 @@ Aside from Console logging, all other handlers supports up to 5 different log fo
LogLib2 is designed to be silent-failing, this means that if an error occurs while logging an event, the library will
silently fail and continue to log events, this is to prevent the application from crashing due to a logging error.
## Community
This project and many others from Nosial are available on multiple publicly available and free git repositories at
- [n64](https://git.n64.cc/nosial/loglib2)
- [GitHub](https://github.com/nosial/loglib2)
- [Codeberg](https://codeberg.org/nosial/loglib2)
Issues & Pull Requests are frequently checked and to be referenced accordingly in commits and changes, Nosial remains
dedicated to keep these repositories up to date when possible.
For questions & discussions see the public Telegram community at [@NosialDiscussions](https://t.me/NosialDiscussions).
We do encourage community support and discussions, please be respectful and follow the rules of the community.
## Table of Contents
<!-- TOC -->
* [LogLib2](#loglib2)
* [Community](#community)
* [Table of Contents](#table-of-contents)
* [Installation](#installation)
* [Compiling](#compiling)

View file

@ -9,7 +9,7 @@
"assembly": {
"name": "LogLib2",
"package": "net.nosial.loglib2",
"version": "1.0.0",
"version": "1.0.3",
"uuid": "11ac2c4d-94e5-4cc1-a2d3-054ac3f425b4"
},
"build": {
@ -25,7 +25,7 @@
{
"name": "net.nosial.optslib",
"version": "latest",
"source": "nosial/libs.opts=latest@n64"
"source": "nosial/optslib=latest@github"
}
],
"configurations": [

View file

@ -115,7 +115,8 @@
return match(strtolower(gettype($input)))
{
'boolean', 'integer', 'double', 'float', 'string', 'null' => $input,
'boolean', 'integer', 'double', 'float', 'string' => $input,
'null' => 'null',
default => sprintf('[%s]', strtoupper(gettype($input))),
};
}

View file

@ -23,14 +23,24 @@
*
* @param string $name The name of the exception.
* @param string $message The exception message.
* @param int|null $code The exception code, or null if not specified.
* @param string|int|null $code The exception code, or null if not specified. If a string is provided, it will be converted to an integer.
* @param string|null $file The file name, or null if not specified.
* @param int|null $line The line number, or null if not specified.
* @param string|int|null $line The line number, or null if not specified. If a string is provided, it will be converted to an integer.
* @param StackTrace[]|null $trace The array of StackTrace instances, or null if not provided.
* @param ExceptionDetails|null $previous The previous exception, or null if not specified.
*/
public function __construct(string $name, string $message, ?int $code=null, ?string $file=null, ?int $line=null, ?array $trace=null, ?ExceptionDetails $previous=null)
public function __construct(string $name, string $message, null|string|int $code=null, ?string $file=null, null|string|int $line=null, ?array $trace=null, ?ExceptionDetails $previous=null)
{
if(is_string($line))
{
$line = (int)$line;
}
if(is_string($code))
{
$code = (int)$code;
}
$this->name = $name;
$this->message = $message;
$this->code = $code;