-
Notifications
You must be signed in to change notification settings - Fork 0
Log.cc usage
Welcome to the log.cc wiki!
Note
The basic functions are introduced in README.md
. Here I will tell you more functions defined in Log.cc.
The following examples use l
as the default logger name.
You can use the setLogLevel
function.
l.setLogLevel(WARNING);
Now only log message which are more important than (or as important as) Warning will me shown.
Use function getLogLevel
.
- Return value: int
You can use the disable
function.
Example: l.disable();
To enable the logger again, use the enable
function.
Tip
Sometimes, it's necessary to disable the terminal log output (especially when developing a GUI app, users don't want to see a terminal with plenty of messages).
l.disableTerminalOutput();
To enable terminal output again, use the enableTerminalOutput
function.
Use function generateFilename
string name
:The name of your application, "log" by default
string filenameExtension
:The filename extension for your log file, "txt" by default. Note that you don't have to include a dot in it. Filename extensions do not matter for Unix-like Operating Systems. However, it will be greate to customize your own filename extension, you may want something like ".log" instead of ".txt".
You can view log.cc
and log.h
in the src/
dir.