Skip to content

Commit

Permalink
Merge pull request #93 from Wolkabout/feature/log_to_file
Browse files Browse the repository at this point in the history
log to file
  • Loading branch information
srdjastankovic authored Nov 2, 2023
2 parents 8d35195 + 4081efe commit e542d41
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-20.04
timeout-minutes: 20
timeout-minutes: 30

steps:
- uses: actions/checkout@v1
Expand Down
3 changes: 3 additions & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

WolkGateway bridges communication between WolkAbout IoT platform and multiple devices connected to it.

**Version 5.1.5**
- [IMPROVEMENT] - Logging output to file at location '/var/log/wolkGateway'

**Version 5.1.4**
- [IMPROVEMENT] - Store the application/library files in separated folder from the rest of the software.

Expand Down
7 changes: 5 additions & 2 deletions application/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include "wolk/service/firmware_update/debian/DebianPackageInstaller.h"

#include <chrono>
#include <iostream>
#include <random>
#include <stdexcept>
#include <string>
#include <thread>
#include <iostream>

using namespace wolkabout;
using namespace wolkabout::connect;
Expand All @@ -34,6 +34,8 @@ using namespace wolkabout::legacy;

namespace
{
const auto LOG_FILE = "/var/log/wolkGateway/wolkgateway.log";

class DefaultDataProvider : public DataProvider
{
public:
Expand Down Expand Up @@ -120,7 +122,8 @@ int main(int argc, char** argv)
}
return wolkabout::legacy::LogLevel::INFO;
}();
wolkabout::legacy::Logger::init(level, wolkabout::legacy::Logger::Type::CONSOLE);
wolkabout::legacy::Logger::init(
level, wolkabout::legacy::Logger::Type::CONSOLE | wolkabout::legacy::Logger::Type::FILE, LOG_FILE);

wolkabout::GatewayConfiguration gatewayConfiguration;
try
Expand Down
6 changes: 3 additions & 3 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wolkgateway (5.1.4) stable; urgency=medium
wolkgateway (5.1.5) stable; urgency=medium

* Store the application/library files in separated folder from the rest of the software.
* Logging output to file at location '/var/log/wolkGateway'

-- Wolkabout ELab <elab@wolkabout.com> Fri, 20 Oct 2023 00:00:00 +0100
-- Wolkabout ELab <elab@wolkabout.com> Wedn, 01 Nov 2023 00:00:00 +0100
1 change: 1 addition & 0 deletions debian/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/var/log/wolkGateway
1 change: 1 addition & 0 deletions debian/postrm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

if [ "$1" = "purge" ] ; then
rm -rf /etc/wolkGateway
rm -rf /var/log/wolkGateway
fi

#DEBHELPER#

0 comments on commit e542d41

Please sign in to comment.