提交 d2905a4e 编写于 作者: Y YoungJQ

iSulad : isula logs command add timestamps options

Signed-off-by: NYoungJQ <yangjiaqi11@huawei.com>
上级 41705c67
......@@ -290,6 +290,7 @@ struct client_arguments {
// logs
bool follow;
bool timestamps;
/*
* tail < 0: show all logs
* tail = 0: do not show log
......
......@@ -67,7 +67,7 @@ static int do_logs(const struct client_arguments *args)
request->runtime = util_strdup_s(args->runtime);
request->follow = args->follow;
request->tail = (int64_t)args->tail;
request->timestamps = args->timestamps;
config = get_connect_config(args);
ret = ops->container.logs(request, response, &config);
if (ret != 0) {
......
......@@ -28,9 +28,10 @@ extern "C" {
#define LOGS_OPTIONS(cmdargs) \
{ CMD_OPT_TYPE_BOOL, false, "follow", 'f', &(cmdargs).follow, "Follow log output", NULL }, \
{ \
CMD_OPT_TYPE_CALLBACK, false, "tail", 0, &(cmdargs).tail, "Number of lines to show from the end of the logs", \
callback_tail \
}
CMD_OPT_TYPE_CALLBACK, false, "tail", 0, &(cmdargs).tail, "Number of lines to show from the end of the logs", \
callback_tail \
}, \
{ CMD_OPT_TYPE_BOOL, false, "timestamps", 't', &(cmdargs).timestamps, "Show timestamps", NULL }
extern const char g_cmd_logs_desc[];
extern const char g_cmd_logs_usage[];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册