Skip to content

Commit 4533af7

Browse files
committed
Change the default to non-log-style stdout/stderr output for the CLI.
For the Linux PBA, the default is that everything goes to stderr in log style (prepended with the date). If the user would like log style output sent to stderr only with the CLI, the new -l option will turn that on.
1 parent e78ecd5 commit 4533af7

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

Common/DtaOptions.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ void usage()
3030
printf("sedutil-cli <-v> <-n> <action> <options> <device>\n");
3131
printf("-v (optional) increase verbosity, one to five v's\n");
3232
printf("-n (optional) no password hashing. Passwords will be sent in clear text!\n");
33+
printf("-l (optional) log style output to stderr only\n");
3334
printf("actions \n");
3435
printf("--scan \n");
3536
printf(" Scans the devices on the system \n");
@@ -133,10 +134,10 @@ uint8_t DtaOptions(int argc, char * argv[], DTA_OPTIONS * opts)
133134
opts->no_hash_passwords = true;
134135
LOG(D) << "Password hashing is disabled";
135136
}
136-
else if (!strcmp("-x", argv[i])) {
137+
else if (!strcmp("-l", argv[i])) {
137138
baseOptions += 1;
138-
opts->output_format = sedutilReadable;
139-
output_format = sedutilReadable;
139+
opts->output_format = sedutilNormal;
140+
outputFormat = sedutilNormal;
140141
}
141142
else if (!(('-' == argv[i][0]) && ('-' == argv[i][1])) &&
142143
(0 == opts->action))

Common/log.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -313,12 +313,12 @@ class FILELOG_DECLSPEC RCLog : public RLog<Output2FILE> {
313313
else if (level > CLog::Level() || !Output2FILE::Stream()) ; \
314314
else
315315

316-
extern sedutiloutput output_format;
316+
extern sedutiloutput outputFormat;
317317

318318
#define LOGX(level) \
319319
if (level > CLOG_MAX_LEVEL) ;\
320320
else if (level > RCLog::Level() || !Output2FILE::Stream()) ; \
321-
else RCLog().Get(level, output_format)
321+
else RCLog().Get(level, outputFormat)
322322
#define LOG LOGX
323323

324324
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)

Common/sedutil.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ along with sedutil. If not, see <http://www.gnu.org/licenses/>.
2929

3030
using namespace std;
3131

32-
sedutiloutput output_format;
32+
/* Default to output that omits timestamps and goes to stdout */
33+
sedutiloutput outputFormat = sedutilReadable;
3334

3435
int isValidSEDDisk(char *devname)
3536
{

LinuxPBA/LinuxPBA.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ This software is Copyright 2014-2017 Bright Plaza Inc. <[email protected]
2828

2929
using namespace std;
3030

31+
/* Default to output that includes timestamps and goes to stderr*/
32+
sedutiloutput outputFormat = sedutilNormal;
33+
3134
int main(int argc, char** argv) {
3235

3336
CLog::Level() = CLog::FromInt(0);

0 commit comments

Comments
 (0)