CmdStop: Removed log

This commit is contained in:
Paul Beckingham 2016-04-06 20:27:32 -04:00
parent 45cbe7d817
commit 086f0e9c03
3 changed files with 3 additions and 6 deletions

View file

@ -35,8 +35,7 @@
int CmdStop (
CLI& cli,
Rules& rules,
Database& database,
Log& log)
Database& database)
{
// Load the most recent interval.
auto latest = database.getLatestInterval ();
@ -48,7 +47,6 @@ int CmdStop (
// Stop it.
latest.end (Datetime ());
database.modifyInterval (latest);
log.write ("debug", std::string ("Stopped tracking: ") + latest.serialize ());
// User feedback.
if (rules.getBoolean ("verbose"))
@ -69,7 +67,6 @@ int CmdStop (
latest.end ({0});
database.addInterval (latest);
log.write ("debug", std::string ("Started tracking: ") + latest.serialize ());
// User feedback.
if (rules.getBoolean ("verbose"))
@ -79,7 +76,6 @@ int CmdStop (
else
{
std::string message = "There is no active time tracking.";
log.write ("warning", message);
if (rules.getBoolean ("verbose"))
std::cout << message << "\n";
}

View file

@ -33,7 +33,6 @@
#include <Extensions.h>
#include <Log.h>
int CmdStop (CLI&, Rules&, Database&, Log&);
int CmdTags ( Rules&, Database&, Log&);
int CmdTrack (CLI&, Rules&, Database&, Log&);
int CmdUndo ( );
@ -51,5 +50,6 @@ int CmdHelp (CLI& );
int CmdImport ( );
int CmdReport (CLI&, Rules&, Database&, Extensions&);
int CmdStart (CLI&, Rules&, Database& );
int CmdStop (CLI&, Rules&, Database& );
#endif

View file

@ -218,6 +218,7 @@ int dispatchCommand (
else if (command == "import") status = CmdImport ( );
else if (command == "report") status = CmdReport (cli, rules, database, extensions);
else if (command == "start") status = CmdStart (cli, rules, database );
else if (command == "stop") status = CmdStop (cli, rules, database );
}
else
{