Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
ace40f29
Commit
ace40f29
authored
Feb 17, 2017
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nghttpx: Update log time stamp in millisecond interval
parent
1133cc0b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
src/shrpx_log.cc
src/shrpx_log.cc
+1
-1
src/shrpx_log_config.cc
src/shrpx_log_config.cc
+14
-0
src/shrpx_log_config.h
src/shrpx_log_config.h
+5
-0
No files found.
src/shrpx_log.cc
View file @
ace40f29
...
...
@@ -141,7 +141,7 @@ Log::~Log() {
char
buf
[
4
_k
];
auto
tty
=
lgconf
->
errorlog_tty
;
lgconf
->
update_tstamp
(
std
::
chrono
::
system_clock
::
now
());
lgconf
->
update_tstamp
_millis
(
std
::
chrono
::
system_clock
::
now
());
// Error log format: <datetime> <master-pid> <current-pid>
// <thread-id> <level> (<filename>:<line>) <msg>
...
...
src/shrpx_log_config.cc
View file @
ace40f29
...
...
@@ -96,6 +96,20 @@ LogConfig *log_config() { return config.get(); }
void
delete_log_config
()
{}
#endif // NOTHREADS
void
LogConfig
::
update_tstamp_millis
(
const
std
::
chrono
::
system_clock
::
time_point
&
now
)
{
if
(
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
now
.
time_since_epoch
())
==
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
time_str_updated
.
time_since_epoch
()))
{
return
;
}
time_str_updated
=
now
;
tstamp
=
std
::
make_shared
<
Timestamp
>
(
now
);
}
void
LogConfig
::
update_tstamp
(
const
std
::
chrono
::
system_clock
::
time_point
&
now
)
{
auto
t0
=
std
::
chrono
::
system_clock
::
to_time_t
(
time_str_updated
);
...
...
src/shrpx_log_config.h
View file @
ace40f29
...
...
@@ -59,6 +59,11 @@ struct LogConfig {
bool
errorlog_tty
;
LogConfig
();
// Updates time stamp if difference between time_str_updated and now
// is 1 or more milliseconds.
void
update_tstamp_millis
(
const
std
::
chrono
::
system_clock
::
time_point
&
now
);
// Updates time stamp if difference between time_str_updated and
// now, converted to time_t, is 1 or more seconds.
void
update_tstamp
(
const
std
::
chrono
::
system_clock
::
time_point
&
now
);
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment