/*
 * SPDX-FileCopyrightText: 2025 Copyright contributors to the cppTango project
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */
#ifndef TANGO_WINDOWS_NTEVENTLOGGER_H
#define TANGO_WINDOWS_NTEVENTLOGGER_H

// clang-format off
#include <winsock2.h> // prevents windows.h from including winsock.h
#include <windows.h>
// clang-format on

#include <string>

namespace Tango
{

//
// This is a custom message logger that is used to dump messages to
// the NT system log -- the user must ensure that this logger is
// used for NT native services
//

// class NTEventLogger : public OB::Logger,
//               public OBCORBA::RefCountLocalObject
class NTEventLogger
{
  private:
    HANDLE eventSource_;  // The event source
    std::string service_; // Service name
    DWORD eventId_;       // The event ID

    void emitMessage(int, const char *);
    bool installValues(HKEY);

  public:
    NTEventLogger(const char *, DWORD);
    virtual ~NTEventLogger();

    bool install();
    bool uninstall();

    virtual void info(const char *);
    virtual void error(const char *);
    virtual void warning(const char *);
    virtual void trace(const char *, const char *);
};

} // namespace Tango

#endif
