File: Main.cpp

package info (click to toggle)
plog 1.1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,404 kB
  • sloc: cpp: 13,637; ansic: 473; sh: 24; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 684 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
//
// Shared - shows how to share logger instances across binary modules (this is the default behavior on everything except Windows, so be careful).
//

#include <plog/Log.h>

// Helper macro to mark functions exported from the library.
#ifdef _WIN32
#   define EXPORT __declspec(dllexport)
#else
#   define EXPORT __attribute__ ((visibility ("default")))
#endif

// Function that produces a log message.
extern "C" void EXPORT foo1()
{
    PLOGI << "Hello from shared lib #1!"; // The message will go to the logger initialized in the main module because PLOG_GLOBAL is defined.
    // On Windows the logger instance is imported from the main module because PLOG_IMPORT is defined.
}