@@ -1055,6 +1055,7 @@ sysdig_init_res sysdig_init(int argc, char **argv)
1055
1055
std::unique_ptr<filter_check_list> filter_list;
1056
1056
std::shared_ptr<sinsp_filter_factory> filter_factory;
1057
1057
color_term_out color_flag = COLOR;
1058
+ bool user_defined_format = false ;
1058
1059
1059
1060
// These variables are for the cycle_writer engine
1060
1061
int duration_seconds = 0 ;
@@ -1427,6 +1428,7 @@ sysdig_init_res sysdig_init(int argc, char **argv)
1427
1428
output_format = optarg;
1428
1429
output_format_plugin = optarg;
1429
1430
}
1431
+ user_defined_format = true ;
1430
1432
1431
1433
break ;
1432
1434
case ' q' :
@@ -1679,18 +1681,21 @@ sysdig_init_res sysdig_init(int argc, char **argv)
1679
1681
}
1680
1682
}
1681
1683
1682
- char * no_color_env = getenv (" NO_COLOR" );
1683
- if ((color_flag == FORCE_COLOR) ||
1684
- (stdout_supports_color () && (no_color_env != nullptr && no_color_env[0 ] != ' \0 ' ) && color_flag == COLOR))
1685
- {
1686
- output_format = R"( *%evt.num %evt.outputtime %evt.cpu \e[01;32m%proc.name\e[00m (\e[01;36m%proc.pid\e[00m.%thread.tid) %evt.dir \e[01;34m%evt.type\e[00m %evt.info)" ;
1687
- output_format_plugin = R"( *%evt.num %evt.datetime.s [\e[01;32m%evt.pluginname\e[00m] %evt.plugininfo)" ;
1688
- }
1689
- else
1690
- {
1691
- output_format = " *%evt.num %evt.outputtime %evt.cpu %proc.name (%thread.tid) %evt.dir %evt.type %evt.info" ;
1692
- output_format_plugin = " *%evt.num %evt.datetime.s [%evt.pluginname] %evt.plugininfo" ;
1693
- }
1684
+ if (!user_defined_format)
1685
+ {
1686
+ char * no_color_env = getenv (" NO_COLOR" );
1687
+ if ((color_flag == FORCE_COLOR) ||
1688
+ (stdout_supports_color () && no_color_env == nullptr && color_flag == COLOR))
1689
+ {
1690
+ output_format = R"( *%evt.num %evt.outputtime %evt.cpu \e[01;32m%proc.name\e[00m (\e[01;36m%proc.pid\e[00m.%thread.tid) %evt.dir \e[01;34m%evt.type\e[00m %evt.info)" ;
1691
+ output_format_plugin = R"( *%evt.num %evt.datetime.s [\e[01;32m%evt.pluginname\e[00m] %evt.plugininfo)" ;
1692
+ }
1693
+ else
1694
+ {
1695
+ output_format = " *%evt.num %evt.outputtime %evt.cpu %proc.name (%thread.tid) %evt.dir %evt.type %evt.info" ;
1696
+ output_format_plugin = " *%evt.num %evt.datetime.s [%evt.pluginname] %evt.plugininfo" ;
1697
+ }
1698
+ }
1694
1699
1695
1700
// given the CLI options, we finish loading and initializing plugins.
1696
1701
// if no plugin has been specified as input with -I, we try to
0 commit comments