Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Christopher Ng
OpenLDAP
Commits
c5f83acf
Commit
c5f83acf
authored
21 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
cleanup
parent
f01c60dd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/liblber/debug.c
+12
-21
12 additions, 21 deletions
libraries/liblber/debug.c
with
12 additions
and
21 deletions
libraries/liblber/debug.c
+
12
−
21
View file @
c5f83acf
...
...
@@ -32,12 +32,6 @@
#include
"lber.h"
#include
"ldap_pvt.h"
struct
DEBUGLEVEL
{
char
*
subsystem
;
int
level
;
};
int
ldap_loglevels
[
LDAP_SUBSYS_NUM
];
static
FILE
*
log_file
=
NULL
;
...
...
@@ -60,15 +54,15 @@ static int debug2syslog(int l) {
}
#endif
static
char
*
lutil
_levels
[]
=
{
static
char
*
debug
_levels
[]
=
{
"emergency"
,
"alert"
,
"critical"
,
"error"
,
"warning"
,
"notice"
,
"information"
,
"entry"
,
"args"
,
"results"
,
"detail1"
,
"detail2"
,
NULL
};
static
char
*
lutil
_subsys
[
LDAP_SUBSYS_NUM
]
=
{
"GLOBAL"
,
"OPERATION"
,
"TRANSPORT"
,
static
char
*
debug
_subsys
[
LDAP_SUBSYS_NUM
]
=
{
"GLOBAL"
,
"OPERATION"
,
"TRANSPORT"
,
"CONNECTION"
,
"FILTER"
,
"BER"
,
"CONFIG"
,
"ACL"
,
"CACHE"
,
"INDEX"
,
"LDIF"
,
"TOOLS"
,
"SLAPD"
,
"SLURPD"
,
...
...
@@ -79,7 +73,7 @@ int lutil_mnem2subsys( const char *subsys )
{
int
i
;
for
(
i
=
0
;
i
<
LDAP_SUBSYS_NUM
;
i
++
)
{
if
(
!
strcasecmp
(
subsys
,
lutil
_subsys
[
i
]
)
)
{
if
(
!
strcasecmp
(
subsys
,
debug
_subsys
[
i
]
)
)
{
return
i
;
}
}
...
...
@@ -89,9 +83,8 @@ int lutil_mnem2subsys( const char *subsys )
void
lutil_set_all_backends
(
int
level
)
{
int
i
;
for
(
i
=
0
;
i
<
LDAP_SUBSYS_NUM
;
i
++
)
{
if
(
!
strncasecmp
(
"BACK_"
,
lutil
_subsys
[
i
],
sizeof
(
"BACK_"
)
-
1
)
)
{
if
(
!
strncasecmp
(
"BACK_"
,
debug
_subsys
[
i
],
sizeof
(
"BACK_"
)
-
1
)
)
{
ldap_loglevels
[
i
]
=
level
;
}
}
...
...
@@ -100,8 +93,8 @@ void lutil_set_all_backends( int level )
int
lutil_mnem2level
(
const
char
*
level
)
{
int
i
;
for
(
i
=
0
;
lutil
_levels
[
i
]
!=
NULL
;
i
++
)
{
if
(
!
strcasecmp
(
level
,
lutil
_levels
[
i
]
)
)
{
for
(
i
=
0
;
debug
_levels
[
i
]
!=
NULL
;
i
++
)
{
if
(
!
strcasecmp
(
level
,
debug
_levels
[
i
]
)
)
{
return
i
;
}
}
...
...
@@ -227,7 +220,7 @@ void lutil_log( const int subsys, int level, const char *fmt, ... )
va_list
vl
;
va_start
(
vl
,
fmt
);
ber_get_option
(
NULL
,
LBER_OPT_LOG_PRINT_FILE
,
&
outfile
);
lutil_log_int
(
outfile
,
lutil
_subsys
[
subsys
],
level
,
fmt
,
vl
);
lutil_log_int
(
outfile
,
debug
_subsys
[
subsys
],
level
,
fmt
,
vl
);
va_end
(
vl
);
}
...
...
@@ -267,9 +260,9 @@ void lutil_log_initialize(int argc, char **argv)
global_level
=
atoi
(
optarg
);
ldap_loglevels
[
0
]
=
global_level
;
/*
* if a negative number was used, make the global level the
* maximum sane level.
*/
* if a negative number was used, make the global level the
* maximum sane level.
*/
if
(
global_level
<
0
)
{
global_level
=
65535
;
ldap_loglevels
[
0
]
=
65535
;
...
...
@@ -298,16 +291,14 @@ void (lutil_debug)( int debug, int level, const char *fmt, ... )
ber_set_option
(
NULL
,
LBER_OPT_LOG_PRINT_FILE
,
log_file
);
}
#endif
va_start
(
vl
,
fmt
);
va_start
(
vl
,
fmt
);
vsnprintf
(
buffer
,
sizeof
(
buffer
),
fmt
,
vl
);
buffer
[
sizeof
(
buffer
)
-
1
]
=
'\0'
;
if
(
log_file
!=
NULL
)
{
fputs
(
buffer
,
log_file
);
fflush
(
log_file
);
}
fputs
(
buffer
,
stderr
);
va_end
(
vl
);
}
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