mirror of
https://github.com/vgough/encfs.git
synced 2025-01-26 07:38:35 +01:00
5f0806c5cc
git-vendor-name: easylogging git-vendor-dir: vendor/github.com/muflihun/easyloggingpp git-vendor-repository: https://github.com/muflihun/easyloggingpp git-vendor-ref: master
33 lines
592 B
C++
33 lines
592 B
C++
//
|
|
// This file is part of Easylogging++ samples
|
|
//
|
|
// Usage sample of el::Loggable to make class log-friendly
|
|
//
|
|
// Revision 1.1
|
|
// @author mkhan3189
|
|
//
|
|
|
|
#include "easylogging++.h"
|
|
|
|
INITIALIZE_EASYLOGGINGPP
|
|
|
|
class MyClass : public el::Loggable {
|
|
public:
|
|
MyClass(const std::string& name) : m_name(name) {}
|
|
|
|
virtual inline void log(el::base::type::ostream_t& os) const {
|
|
os << m_name.c_str();
|
|
}
|
|
|
|
|
|
private:
|
|
std::string m_name;
|
|
};
|
|
|
|
int main(void) {
|
|
MyClass c("c");
|
|
MyClass c2("c2");
|
|
LOG(INFO) << "I am " << c << "; and I am " << c2;
|
|
return 0;
|
|
}
|