Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Falk authored and Tobias Falk committed Oct 21, 2020
1 parent 069edf0 commit aac10a1
Show file tree
Hide file tree
Showing 32 changed files with 2,679 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = FLibraryCollection
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.1.3
PROJECT_NUMBER = @FLibraryCollection_VERSION@

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
10 changes: 10 additions & 0 deletions FLogger/FLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@ bool Logger::getStarted() const
return Started;
}

bool Logger::getTerminalOut() const
{
return TerminalOut;
}

void Logger::setTerminalOut(const bool &value)
{
TerminalOut = value;
}

void Logger::setStartText(const std::string &value)
{
if(!Started)
Expand Down
47 changes: 45 additions & 2 deletions FLogger/FLogger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,46 +134,82 @@ class Logger

///
/// \brief getLogName returns the name of the logfile
/// \return std::string
/// \return std::string<br>
///
/// \par See also:
/// setLogName()
///
std::string getLogName() const;
///
/// \brief setLogName sets the logfile name
/// \param value std::string name
///
/// \par See also:
/// getLogName()
///
void setLogName(const std::string &value);

///
/// \brief getPath returns the pathe to the file<br>
/// the standart is ""
/// \return std::string
///
/// \par See also:
/// setPath()
///
std::string getPath() const;
///
/// \brief setPath sets the path to the file
/// \param value std::string
///
/// \par See also:
/// getPath()
///
void setPath(const std::string &value);


///
/// \brief getStartText returns the start text
/// \return std::string
///
/// \par See also:
/// setStartText()
///
std::string getStartText() const;

///
/// \brief setStartText writes the text without date and time
/// \param &value the text that will be written
///
/// \par See also:
/// getStartText()
///
void setStartText(const std::string &value);

///
/// \brief getStarted returns true when started was cald and it was sucsesfull
/// \return 1 when started
///
///
bool getStarted() const;

///
/// \brief getTerminalOut returns true when The messegas should be display on to the std out
/// \return bool
///
/// \par See also:
/// setTerminalOut()
///
bool getTerminalOut() const;

///
/// \brief setTerminalOut sets if the messegas whould writ to the std out(true when it should)
/// \param &value
///
/// \par See also:
/// getTerminalOut()
///
void setTerminalOut(const bool &value);

private:
///
/// \brief file the name of the file wher the log is written in
Expand Down Expand Up @@ -219,6 +255,13 @@ class Logger
/// the standart is ""
///
std::string path = "";

///
/// \brief TerminalOut
/// TerminalOut controls that the text will only be writen to the std: out whe its true<br>
/// the standart is true
///
bool TerminalOut = true;
};

}
Expand Down
25 changes: 25 additions & 0 deletions FQLogger/FQLogger.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Logger : public QObject
/// \brief Logger the constructor of the class
/// \param logName the name of the log
/// \param path the path wher the log is placed the standerd is ./
/// \param parent the Qt standart parent
///
explicit Logger(std::string logName, std::string path = "./", QObject *parent = nullptr);

Expand Down Expand Up @@ -143,49 +144,73 @@ class Logger : public QObject
/// the standart is Qt::DateFormat::ISODate
/// \return time as Qt::DateFormat(https://doc.qt.io/qt-5/qt.html#DateFormat-enum)
///
/// \par See also:
/// setDateFormate()
///
Qt::DateFormat getDateFormate() const;

///
/// \brief setDateFormate sets the date Time formate that is used<br>
/// the standart is Qt::DateFormat::ISODate
/// \param value as Qt::DateFormat(https://doc.qt.io/qt-5/qt.html#DateFormat-enum)
///
/// \par See also:
/// getDateFormate()
///
void setDateFormate(const Qt::DateFormat &value);

///
/// \brief getLogName returns the name of the logfile
/// \return std::string
///
/// \par See also:
/// setLogName()
///
std::string getLogName() const;
///
/// \brief setLogName sets the logfile name
/// \param value std::string name
///
/// \par See also:
/// getLogName()
///
void setLogName(const std::string &value);

///
/// \brief getPath returns the pathe to the file<br>
/// the standart is ""
/// \return std::string
///
/// \par See also:
/// setPath()
///
std::string getPath() const;
///
/// \brief setPath sets the path to the file
/// \param value std::string
///
/// \par See also:
/// getPath()
///
void setPath(const std::string &value);


///
/// \brief getStartText returns the start text
/// \return std::string
///
/// \par See also:
/// setStartText()
///
std::string getStartText() const;

///
/// \brief setStartText writes the text without date and time
/// \param &value the text that will be written
///
/// \par See also:
/// getStartText()
///
void setStartText(const std::string &value);

///
Expand Down
41 changes: 41 additions & 0 deletions doc/ExampleList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Example List
1. example_1(example_1.cpp):<br>
shows how the basic FLogger class is used

#include <iostream>
#include <FLibraryCollection/FLogger/FLogger.hpp>

int main(int argc, char *argv[])
{
//Creating the class
FLogger::Logger log;
//creating the cass with log file name and path

//seting up all the parameters
log.setLogName("log_example_1"); //Here the name of the Log file will be set the time of creation will be writen in front
log.setPath("logs/"); //Here the path to the Log file will be set if you want the file to be in the main folder leaf it empty
log.setStartText("Start Text"); //Here the text that will be writen at the beginging of the log is set if you don't call it it will be empty
log.setEndText("End Text"); //Here the text that will be writen at the beginging of the log is set if you don't call it it will be END
//starting the logfile
log.start(); //Here the file will be created and opend and all the functions that were caled in the setup will have no effect

//writing to the log simply
log.write("normal write");
log.info("normal info");
log.warning("normal waring");
log.error("normal error");
log.fatalError("normal fatal error");

//writing to the log with error place
log.write("place write", __LINE__, __FILE__, __func__);
log.info("place info", __LINE__, __FILE__, __func__);
log.warning("place waring", __LINE__, __FILE__, __func__);
log.error("place error", __LINE__, __FILE__, __func__);
log.fatalError("place fatal error", __LINE__, __FILE__, __func__);
return 0;
}


2. example_2:<br>
42
11 changes: 11 additions & 0 deletions examples/example_1/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.5)

project(example_1 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

add_executable(example_1
main.cpp
)

target_link_libraries(example_1 PRIVATE FLogger)
11 changes: 11 additions & 0 deletions examples/example_1/build/2020-10-20|13:10:45-FLogger
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
2020-10-20|13:10:45 normal write
2020-10-20|13:10:45 INFO normal info
2020-10-20|13:10:45 WARNING normal waring
2020-10-20|13:10:45 ERROR normal error
2020-10-20|13:10:45 FATAL normal fatal error
2020-10-20|13:10:45 File: /home/tobias/git/FLibraryCollection/examples/example_1/main.cpp Line: 26 Function: main place write
2020-10-20|13:10:45 INFO File: /home/tobias/git/FLibraryCollection/examples/example_1/main.cpp Line: 27 Function: main place info
2020-10-20|13:10:45 WARNING File: /home/tobias/git/FLibraryCollection/examples/example_1/main.cpp Line: 28 Function: main place waring
2020-10-20|13:10:45 ERROR File: /home/tobias/git/FLibraryCollection/examples/example_1/main.cpp Line: 29 Function: main place error
2020-10-20|13:10:45 FATAL File: /home/tobias/git/FLibraryCollection/examples/example_1/main.cpp Line: 30 Function: main place fatal error
End Text
Loading

0 comments on commit aac10a1

Please sign in to comment.