From 1368b271b0fd4c46b90db211952104de535691c4 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Wed, 29 Mar 2023 18:43:32 +0300 Subject: [PATCH] v0.3.0-dev.7 Updating the singlog library to 0.2.1 --- README.md | 5 +++++ dub.json | 2 +- dub.selections.json | 2 +- source/readconf.d | 14 +++++++------- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7d1ef1a..5f546d5 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,11 @@

readconf

+[![license](https://img.shields.io/github/license/AlexanderZhirov/readconf.svg?sort=semver&style=for-the-badge&color=green)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html) +[![main](https://img.shields.io/badge/dynamic/json.svg?label=git.zhirov.kz&style=for-the-badge&url=https://git.zhirov.kz/api/v1/repos/dlang/readconf/tags&query=$[0].name&color=violet)](https://git.zhirov.kz/dlang/readconf) +[![githab](https://img.shields.io/github/v/tag/AlexanderZhirov/readconf.svg?sort=semver&style=for-the-badge&color=blue&label=github)](https://github.com/AlexanderZhirov/readconf) +[![dub](https://img.shields.io/dub/v/readconf.svg?sort=semver&style=for-the-badge&color=orange)](https://code.dlang.org/packages/readconf) + Singleton for reading the configuration file required for your program. ## What can do diff --git a/dub.json b/dub.json index 7f3fc7f..50b4a10 100644 --- a/dub.json +++ b/dub.json @@ -33,6 +33,6 @@ ], "targetName": "readconf", "dependencies": { - "singlog": "~>0.1.0" + "singlog": "~>0.2.1" } } \ No newline at end of file diff --git a/dub.selections.json b/dub.selections.json index 377bd39..a98f018 100644 --- a/dub.selections.json +++ b/dub.selections.json @@ -3,6 +3,6 @@ "versions": { "datefmt": "1.0.4", "silly": "1.1.1", - "singlog": "0.1.0" + "singlog": "0.2.1" } } diff --git a/source/readconf.d b/source/readconf.d index fa38309..e518d53 100644 --- a/source/readconf.d +++ b/source/readconf.d @@ -46,8 +46,8 @@ private: try { configuration = File(this.path, "r"); } catch (Exception e) { - Log.msg.warning("Unable to open the configuration file " ~ this.path); - Log.msg.error(e); + log.w("Unable to open the configuration file " ~ this.path); + log.e(e); return false; } @@ -93,8 +93,8 @@ private: configuration.close(); this.readed = true; } catch (Exception e) { - Log.msg.warning("Unable to close the configuration file " ~ this.path); - Log.msg.error(e); + log.w("Unable to close the configuration file " ~ this.path); + log.e(e); this.configs.remove(configName); this.readed = false; } @@ -272,7 +272,7 @@ struct ConfigSection private void add(ConfigParameter parameter) { if (parameter.property in parameters) - Log.msg.warning("The parameter exists but will be overwritten"); + log.w("The parameter exists but will be overwritten"); this.parameters[parameter.property] = parameter; } @@ -319,8 +319,8 @@ struct ConfigParameter try { return this.value.to!T; } catch (Exception e) { - Log.msg.warning("Cannot convert type"); - Log.msg.error(e); + log.w("Cannot convert type"); + log.e(e); return T.init; } }