Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
cellframe-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
20
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
cellframe-sdk
Commits
9b95c14e
Commit
9b95c14e
authored
5 years ago
by
dmitriy.gerasimov
Browse files
Options
Downloads
Plain Diff
Merge branch 'bugs-2614' into 'master'
Logger issues See merge request
libdap!20
parents
efd69f3c
6d489b04
No related branches found
No related tags found
1 merge request
!24
Support 3689
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/dap_common.c
+7
-17
7 additions, 17 deletions
src/dap_common.c
with
7 additions
and
17 deletions
src/dap_common.c
+
7
−
17
View file @
9b95c14e
...
@@ -246,9 +246,11 @@ int dap_common_init( const char *a_console_title, const char *a_log_file )
...
@@ -246,9 +246,11 @@ int dap_common_init( const char *a_console_title, const char *a_log_file )
{
{
srand
(
(
unsigned
int
)
time
(
NULL
)
);
srand
(
(
unsigned
int
)
time
(
NULL
)
);
/*
#ifdef _WIN32
#ifdef _WIN32
SetupConsole
(
console_title
,
L"Lucida Console"
,
12
,
20
);
SetupConsole(
a_
console_title, L"Lucida Console", 12, 20 );
#endif
#endif
*/
s_start_time
=
time
(
NULL
);
s_start_time
=
time
(
NULL
);
...
@@ -596,10 +598,10 @@ static void *log_thread_proc( void *arg )
...
@@ -596,10 +598,10 @@ static void *log_thread_proc( void *arg )
#if 1
#if 1
#ifdef _WIN32
#ifdef _WIN32
// if ( !bUseANSIEscapeSequences )
// if ( !bUseANSIEscapeSequences )
SetConsoleTextAttribute
(
hWin32ConOut
,
log_level_colors
[
logstr
->
tag
]
);
SetConsoleTextAttribute
(
hWin32ConOut
,
log_level_colors
[
l_
logstr
->
tag
]
);
// WriteConsole( hWin32ConOut, buf0 + time_offset, len - time_offset, &tmp, NULL );
// WriteConsole( hWin32ConOut, buf0 + time_offset, len - time_offset, &tmp, NULL );
// fwrite( buf0 + time_offset, len - time_offset, 1, stdout );
// fwrite( buf0 + time_offset, len - time_offset, 1, stdout );
WriteFile
(
hWin32ConOut
,
logstr
->
str
,
logstr
->
len
,
(
LPDWORD
)
&
tmp
,
NULL
);
WriteFile
(
hWin32ConOut
,
l_
logstr
->
str
,
l_
logstr
->
len
,
(
LPDWORD
)
&
tmp
,
NULL
);
#else
#else
fwrite
(
s_ansi_seq_color
[
l_logstr
->
tag
],
10
,
1
,
stdout
);
fwrite
(
s_ansi_seq_color
[
l_logstr
->
tag
],
10
,
1
,
stdout
);
fwrite
(
l_logstr
->
str
,
l_logstr
->
len
,
1
,
stdout
);
fwrite
(
l_logstr
->
str
,
l_logstr
->
len
,
1
,
stdout
);
...
@@ -774,10 +776,10 @@ void _log_it2( const char *log_tag, enum dap_log_level ll, const char *fmt,... )
...
@@ -774,10 +776,10 @@ void _log_it2( const char *log_tag, enum dap_log_level ll, const char *fmt,... )
#ifdef _WIN32
#ifdef _WIN32
// if ( !bUseANSIEscapeSequences )
// if ( !bUseANSIEscapeSequences )
SetConsoleTextAttribute
(
hWin32ConOut
,
log_level_colors
[
l
ogstr
->
tag
]
);
SetConsoleTextAttribute
(
hWin32ConOut
,
log_level_colors
[
l
l
]
);
// WriteConsole( hWin32ConOut, buf0 + time_offset, len - time_offset, &tmp, NULL );
// WriteConsole( hWin32ConOut, buf0 + time_offset, len - time_offset, &tmp, NULL );
// fwrite( buf0 + time_offset, len - time_offset, 1, stdout );
// fwrite( buf0 + time_offset, len - time_offset, 1, stdout );
WriteFile
(
hWin32ConOut
,
logstr
->
str
,
logstr
->
len
,
(
LPDWORD
)
&
tmp
,
NULL
);
WriteFile
(
hWin32ConOut
,
buf0
+
time_offset
,
len
-
time_offset
,
(
LPDWORD
)
&
tmp
,
NULL
);
#else
#else
fwrite
(
s_ansi_seq_color
[
ll
],
10
,
1
,
stdout
);
fwrite
(
s_ansi_seq_color
[
ll
],
10
,
1
,
stdout
);
fwrite
(
buf0
+
time_offset
,
len
-
time_offset
,
1
,
stdout
);
fwrite
(
buf0
+
time_offset
,
len
-
time_offset
,
1
,
stdout
);
...
@@ -786,18 +788,6 @@ void _log_it2( const char *log_tag, enum dap_log_level ll, const char *fmt,... )
...
@@ -786,18 +788,6 @@ void _log_it2( const char *log_tag, enum dap_log_level ll, const char *fmt,... )
// buf0[ len++ ] = 0;
// buf0[ len++ ] = 0;
log_log
(
(
char
*
)(
buf0
+
time_offset
),
len
-
time_offset
,
t
);
log_log
(
(
char
*
)(
buf0
+
time_offset
),
len
-
time_offset
,
t
);
#if 0
#ifdef _WIN32
// if ( !bUseANSIEscapeSequences )
SetConsoleTextAttribute( hWin32ConOut, log_level_colors[ll] );
// WriteConsole( hWin32ConOut, buf0 + time_offset, len - time_offset, &tmp, NULL );
// fwrite( buf0 + time_offset, len - time_offset, 1, stdout );
WriteFile( hWin32ConOut, buf0 + time_offset, len - time_offset, (LPDWORD)&tmp, NULL );
#else
fwrite( buf0, len, 1, stdout );
#endif
#endif
// printf("\x1b[0m\n");
// printf("\x1b[0m\n");
pthread_mutex_unlock
(
&
mutex
);
pthread_mutex_unlock
(
&
mutex
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment