MCPcopy Create free account
hub / github.com/Apress/design-patterns-in-modern-cpp / ConsoleLogger

Class ConsoleLogger

Structural/NullObject/nullobject.cpp:74–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

72shared_ptr<Logger> BankAccount::no_logging{};
73
74struct ConsoleLogger : Logger
75{
76 void info(const string& s) override
77 {
78 cout << "INFO: " << s << endl;
79 }
80
81 void warn(const string& s) override
82 {
83 cout << "WARNING!!! " << s << endl;
84 }
85};
86
87// similar idea
88struct EmailLogger : Logger

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected