summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-05-21 16:44:06 +0100
committerCarl Hetherington <cth@carlh.net>2014-05-21 16:44:06 +0100
commit71d8cf20889a3c419c9a3e485f461236e5317423 (patch)
treefb2108412c8a172b423cfe48b15a5f31617eade3 /src/tools
parentd2fef4faff679d564a72543c858c4bfb62f85791 (diff)
Tidy up logging a bit. Make it configurable from the GUI.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/dcpomatic.cc12
-rw-r--r--src/tools/dcpomatic_cli.cc8
2 files changed, 10 insertions, 10 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc
index 28074a4ba..d092992a1 100644
--- a/src/tools/dcpomatic.cc
+++ b/src/tools/dcpomatic.cc
@@ -74,7 +74,7 @@ using boost::dynamic_pointer_cast;
static FilmEditor* film_editor = 0;
static FilmViewer* film_viewer = 0;
static shared_ptr<Film> film;
-static std::string log_level;
+static std::string log_types = "general,log,warning";
static std::string film_to_load;
static std::string film_to_create;
static std::string content_to_add;
@@ -157,7 +157,7 @@ load_film (boost::filesystem::path file)
for (list<string>::const_iterator i = notes.begin(); i != notes.end(); ++i) {
error_dialog (0, std_to_wx (*i));
}
- film->log()->set_level (log_level);
+ film->log()->set_types (log_types);
}
#define ALWAYS 0x0
@@ -401,7 +401,7 @@ private:
maybe_save_then_delete_film ();
film.reset (new Film (d->get_path ()));
film->write_metadata ();
- film->log()->set_level (log_level);
+ film->log()->set_types (log_types);
film->set_name (boost::filesystem::path (d->get_path()).filename().generic_string());
set_film ();
}
@@ -609,7 +609,7 @@ private:
};
static const wxCmdLineEntryDesc command_line_description[] = {
- { wxCMD_LINE_OPTION, "l", "log", "set log level (silent, verbose or timing)", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
+ { wxCMD_LINE_OPTION, "l", "log", "set message types to log (general,warning,error,timing)", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_SWITCH, "n", "new", "create new film", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_OPTION, "c", "content", "add content file", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
{ wxCMD_LINE_PARAM, 0, 0, "film to load or create", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL },
@@ -668,7 +668,7 @@ class App : public wxApp
if (!film_to_create.empty ()) {
film.reset (new Film (film_to_create));
film->write_metadata ();
- film->log()->set_level (log_level);
+ film->log()->set_types (log_types);
film->set_name (boost::filesystem::path (film_to_create).filename().generic_string ());
}
@@ -728,7 +728,7 @@ class App : public wxApp
wxString log;
if (parser.Found (wxT ("log"), &log)) {
- log_level = wx_to_std (log);
+ log_types = wx_to_std (log);
}
return true;
diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc
index a74ece149..73067f406 100644
--- a/src/tools/dcpomatic_cli.cc
+++ b/src/tools/dcpomatic_cli.cc
@@ -65,7 +65,7 @@ main (int argc, char* argv[])
string film_dir;
bool progress = true;
bool no_remote = false;
- int log_level = 0;
+ string log_types = "general,warning,error";
int json_port = 0;
bool keep_going = false;
@@ -78,7 +78,7 @@ main (int argc, char* argv[])
{ "flags", no_argument, 0, 'f'},
{ "no-progress", no_argument, 0, 'n'},
{ "no-remote", no_argument, 0, 'r'},
- { "log-level", required_argument, 0, 'l' },
+ { "log-types", required_argument, 0, 'l' },
{ "json", required_argument, 0, 'j' },
{ "keep-going", no_argument, 0, 'k' },
{ 0, 0, 0, 0 }
@@ -110,7 +110,7 @@ main (int argc, char* argv[])
no_remote = true;
break;
case 'l':
- log_level = atoi (optarg);
+ log_types = optarg;
break;
case 'j':
json_port = atoi (optarg);
@@ -155,7 +155,7 @@ main (int argc, char* argv[])
exit (EXIT_FAILURE);
}
- film->log()->set_level ((Log::Level) log_level);
+ film->log()->set_types (log_types);
cout << "\nMaking DCP for " << film->name() << "\n";
// cout << "Content: " << film->content() << "\n";