diff options
author | 2023-11-02 14:21:18 +0600 | |
---|---|---|
committer | 2023-11-02 14:21:55 +0600 | |
commit | 9968379aee5be5b5875ac7732c52e59059f30a0e (patch) | |
tree | f4c86a3d57d1b2da90b9ff4cce7461d4ced42984 | |
parent | da6cbb7099161c6562d127e3b3e268eb229a9c46 (diff) | |
download | shopno-os-log-sync-9968379aee5be5b5875ac7732c52e59059f30a0e.tar.gz shopno-os-log-sync-9968379aee5be5b5875ac7732c52e59059f30a0e.zip |
Bump logger version for breaking changes
Signed-off-by: Mubashshir <ahm@jadupc.com>
-rw-r--r-- | src/system-stats/common.h | 7 | ||||
-rw-r--r-- | src/system-stats/logger.cpp | 31 | ||||
-rw-r--r-- | src/system-stats/system-stats.cpp | 1 |
3 files changed, 21 insertions, 18 deletions
diff --git a/src/system-stats/common.h b/src/system-stats/common.h index 230690d..08aceca 100644 --- a/src/system-stats/common.h +++ b/src/system-stats/common.h @@ -3,9 +3,12 @@ #include <fstream> #include <functional> #include <filesystem> - -#define APP_VERSION "2.2" #define APP_NAME "system-stats" +#define APP_MAJOR 3 +#define APP_MINOR 0 + +#define VERSION_STRING(MAJOR, MINOR) #MAJOR "." #MINOR +#define APP_VERSION VERSION_STRING(APP_MAJOR, APP_MINOR) using refstream = std::reference_wrapper<std::ostream>; diff --git a/src/system-stats/logger.cpp b/src/system-stats/logger.cpp index 418e693..319e184 100644 --- a/src/system-stats/logger.cpp +++ b/src/system-stats/logger.cpp @@ -25,21 +25,20 @@ const std::string LogFile::date() void demo_perms(std::filesystem::perms p) { - using std::filesystem::perms; - auto show = [=](char op, perms perm) - { - std::cerr << (perms::none == (perm & p) ? '-' : op); - }; - show('r', perms::owner_read); - show('w', perms::owner_write); - show('x', perms::owner_exec); - show('r', perms::group_read); - show('w', perms::group_write); - show('x', perms::group_exec); - show('r', perms::others_read); - show('w', perms::others_write); - show('x', perms::others_exec); - std::cerr << '\n'; + using std::filesystem::perms; + auto show = [=](char op, perms perm) { + std::cerr << (perms::none == (perm & p) ? '-' : op); + }; + show('r', perms::owner_read); + show('w', perms::owner_write); + show('x', perms::owner_exec); + show('r', perms::group_read); + show('w', perms::group_write); + show('x', perms::group_exec); + show('r', perms::others_read); + show('w', perms::others_write); + show('x', perms::others_exec); + std::cerr << '\n'; } LogFile::LogFile() @@ -78,5 +77,5 @@ void LogFile::change(refstream& fstr) } if(not stream.is_open()) - stream.open(base / (date_ + ".log")); + stream.open(base / (date_ + ".log"), std::ios::app); } diff --git a/src/system-stats/system-stats.cpp b/src/system-stats/system-stats.cpp index 6a9549c..6f6555a 100644 --- a/src/system-stats/system-stats.cpp +++ b/src/system-stats/system-stats.cpp @@ -19,6 +19,7 @@ int main() ).count(); stream.get() << "begin\t" << epoch << std::endl; + stream.get() << "ver\t" << APP_MAJOR << "\t" << APP_MINOR << std::endl; stream.get() << dumpReport(); stream.get() << "end\t" << epoch << std::endl; |