Skip to content

Commit

Permalink
Revise console logging in Ref app
Browse files Browse the repository at this point in the history
Use Os::Log instead of custom implementation
  • Loading branch information
bocchino committed Nov 16, 2021
1 parent 2e3cb0e commit d472832
Showing 1 changed file with 3 additions and 29 deletions.
32 changes: 3 additions & 29 deletions Ref/Top/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <cstdlib>
#include <ctype.h>

#include "Fw/Logger/Logger.hpp"
#include <Os/Log.hpp>
#include <Ref/Top/RefTopologyAc.hpp>

void print_usage(const char* app) {
Expand All @@ -12,33 +12,9 @@ void print_usage(const char* app) {
#include <signal.h>
#include <cstdio>

class Logger :
public Fw::Logger
{

public:

void log(
const char* fmt,
POINTER_CAST a0 = 0,
POINTER_CAST a1 = 0,
POINTER_CAST a2 = 0,
POINTER_CAST a3 = 0,
POINTER_CAST a4 = 0,
POINTER_CAST a5 = 0,
POINTER_CAST a6 = 0,
POINTER_CAST a7 = 0,
POINTER_CAST a8 = 0,
POINTER_CAST a9 = 0
) {
printf(fmt, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
fflush(stdout);
}

};

Ref::TopologyState state;
Logger logger;
// Enable the console logging provided by Os::Log
Os::Log logger;

volatile sig_atomic_t terminate = 0;

Expand Down Expand Up @@ -96,8 +72,6 @@ int main(int argc, char* argv[]) {
}
}

Fw::Logger::registerLogger(&logger);

(void) printf("Hit Ctrl-C to quit\n");

state = Ref::TopologyState(hostname, port_number);
Expand Down

0 comments on commit d472832

Please sign in to comment.