diff options
| author | 2016-02-24 22:21:40 +0000 | |
|---|---|---|
| committer | 2016-02-24 22:21:40 +0000 | |
| commit | 503ebdbc5ecae9dda74124a4350c40f81a695c02 (patch) | |
| tree | bca9486d98788b529f5e722e5d085746f20f022d /cmds/dumpstate/dumpstate.cpp | |
| parent | 0a2c2fb459b539a98e7d34fdaf48e6e2a514f65e (diff) | |
| parent | 88c7933df551f6dadd8cc931d104b01d6d1609e4 (diff) | |
Merge "Improved dumpstate logging." into nyc-dev
Diffstat (limited to 'cmds/dumpstate/dumpstate.cpp')
| -rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp index 0471fc04eb..3abd8f0b76 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -485,7 +485,8 @@ static void print_header(std::string version) { /* adds a new entry to the existing zip file. */ static bool add_zip_entry_from_fd(const std::string& entry_name, int fd) { if (!zip_writer) { - MYLOGD("Not adding zip entry %s from fd because zip_writer is not set\n", entry_name.c_str()); + MYLOGD("Not adding zip entry %s from fd because zip_writer is not set\n", + entry_name.c_str()); return false; } // Logging statement below is useful to time how long each entry takes, but it's too verbose. @@ -545,6 +546,7 @@ void add_dir(const char *dir, bool recursive) { MYLOGD("Not adding dir %s because zip_writer is not set\n", dir); return; } + MYLOGD("Adding dir %s (recursive: %d)\n", dir, recursive); DurationReporter duration_reporter(dir, NULL); dump_files(NULL, dir, recursive ? skip_none : is_dir, _add_file_from_fd); } @@ -1064,6 +1066,7 @@ int main(int argc, char *argv[]) { } /* parse arguments */ + log_args("Dumpstate command line", argc, const_cast<const char **>(argv)); int c; while ((c = getopt(argc, argv, "dho:svqzpPBRV:")) != -1) { switch (c) { @@ -1325,8 +1328,9 @@ int main(int argc, char *argv[]) { bool do_text_file = true; if (do_zip_file) { - MYLOGD("Adding text entry to .zip bugreport\n"); - if (!finish_zip_file(base_name + "-" + suffix + ".txt", tmp_path, now)) { + std::string entry_name = base_name + "-" + suffix + ".txt"; + MYLOGD("Adding main entry (%s) to .zip bugreport\n", entry_name.c_str()); + if (!finish_zip_file(entry_name, tmp_path, now)) { MYLOGE("Failed to finish zip file; sending text bugreport instead\n"); do_text_file = true; } else { @@ -1334,8 +1338,8 @@ int main(int argc, char *argv[]) { } } if (do_text_file) { - MYLOGD("Generating .txt bugreport\n"); path = bugreport_dir + "/" + base_name + "-" + suffix + ".txt"; + MYLOGD("Generating .txt bugreport at %s from %s\n", path.c_str(), tmp_path.c_str()); if (rename(tmp_path.c_str(), path.c_str())) { MYLOGE("rename(%s, %s): %s\n", tmp_path.c_str(), path.c_str(), strerror(errno)); path.clear(); |