Commit Graph

436 Commits

Author SHA1 Message Date
Armin Novak
ee2839fc7f Caching log filter after first use.
Reduce runtime penalty for log level checks by
remembering the log level found during first call.
2016-03-03 12:43:39 +01:00
Armin Novak
0ea7aea6d9 Remember filter log level. 2016-03-02 19:07:32 +01:00
Armin Novak
41fdac2667 Respecting filter in WLog_GetLogLevel 2016-03-02 14:11:15 +01:00
Bernhard Miklautz
e02af8287e Merge pull request #3160 from akallabeth/stream_fixes
Stream fixes
2016-03-01 16:44:19 +01:00
Armin Novak
a79072a87c Added tests for remaining stream functions. 2016-03-01 12:58:09 +01:00
Armin Novak
1036f1e296 Fixed default visibility.
When nothing is declared, only export symbols defined
with WINPR_API or FREERDP_API defined.
Override this setting if BUILD_TESTING to allow tests
access to internal functions usually not exposed.
2016-02-26 19:44:14 +01:00
Armin Novak
f997421098 Unified hmac functions. 2016-02-24 21:50:08 +01:00
Martin Fleisz
56a0c4c336 Merge pull request #3097 from akallabeth/android_api_upgrade_v4
Android api upgrade and restructuring
2016-02-04 16:20:59 +01:00
Armin Novak
f835744a88 Removed unused variable. 2016-02-03 12:45:49 +01:00
Armin Novak
d1c59f7574 Fixed invalid boolean check. 2016-02-03 11:23:41 +01:00
Armin Novak
61633a1c66 Fixed android build issues. 2016-02-01 15:21:07 +01:00
MartinHaimberger
83b706c4be Merge pull request #3092 from akallabeth/get_build_config
Added get_build_config functions.
2016-01-28 15:23:24 +01:00
Armin Novak
035f127081 Added get_build_config functions. 2016-01-28 14:26:50 +01:00
Armin Novak
c2515340c3 Fixed return value of WLog_FileAppender_WriteImageMessage 2016-01-28 12:08:57 +01:00
Martin Fleisz
7294a7f27d Merge pull request #3078 from akallabeth/wlog_cmd_options
Added new command line options for logger.
2016-01-28 10:33:17 +01:00
David PHAM-VAN
3d22cbe2b8 Fix png image loading that needed write access 2016-01-27 11:02:16 -08:00
Armin Novak
06adbc971a Fixed realloc check, renamed filter variable. 2016-01-27 11:21:04 +01:00
Armin Novak
46a079fcb6 Added new command line options for logger.
The new command line options /log-level:<level> and
/log-filters:<filter>:<level> allow setting default log
level and log module filter to be set.
2016-01-23 15:16:13 +01:00
Armin Novak
d2ab27626a Fix memory leak in lodepng_zlib_compress 2016-01-15 10:16:08 +01:00
Bernhard Miklautz
7c03db342c add parameter buildconfig
Extend winpr and client/common to support a new option "/buildconfig".
When used build the following build specific information is print:
* cmake options
* cflags
* compiler
* target architecture
* cmake build type
2016-01-12 17:32:33 +01:00
Armin Novak
03a1ff814d Fixed unused warnings. 2015-12-16 15:15:46 +01:00
Armin Novak
d0e3528c8e Added winpr_strerror function. 2015-12-09 18:27:37 +01:00
Xiaodong Qi
602d2715a2 Fix compilation error under Visual Studio 2010
Visual Studio 2010 use a compiler that supports only C89, which
only supports declaring variable at top of a local scope. Moving
scope variable to the top of function should solve this problem.
2015-11-29 00:14:29 +08:00
Bernhard Miklautz
bff63b3ee2 wlog: cleanup API includes
Only include necessary header files.
2015-11-10 16:29:09 +01:00
Bernhard Miklautz
be0845b46c wlog/journald: don't set a default identifier
Don't set the identifier to "winpr" as default value because journald
will use the programs name as default if no identifier is set.
This way a program using WLog doesn't need to set an identifier (except
it want something different then it's name).
2015-11-10 13:40:52 +01:00
Bernhard Miklautz
34c707304b wlog: change variable naming and fix documentation
* change State to active and make it BOOL since it's only got two
  used values
* fix some typos in the documentation
2015-11-10 12:05:23 +01:00
Bernhard Miklautz
25137988fe wlog: fix build on windows 2015-11-09 19:47:51 +01:00
Bernhard Miklautz
57f952bbbc wlog: fix android build 2015-11-09 19:37:02 +01:00
Bernhard Miklautz
67368b2ec7 Adapt error level for debug messages
When using xfreerdp a regular invocation should really only report grave
problems as error. "Regular" messages should be either info or even
debug.
2015-11-09 18:27:38 +01:00
Bernhard Miklautz
07417599ce wlog: rework, cleanup and stabilize API
* only expose necessary functions and types in header
* don't expose appender internals
* add generic function WLog_ConfigureAppender to have the possibility
  to configure appender specific settings
* detect appender availability if WLog_SetLogAppenderType or
  WLog_Appender_New return FALSE or NULL respectively the appender isn't
  available or the initialization failed. This is very useful for the
  use with optional appenders.
* add Free to the appender interface. At the time of the Free the
  appender is known and available so it can be called directly (instead
  of calling the right function according to the type)
* make all appender internal function static
* all appenders return the generic wLogAppender type now. Typecasts
  are internally done where necessary this abstracts the appenders more
  cleanly
2015-11-09 18:25:45 +01:00
David FORT
458aaa1213 Take in account @nfedera's remarks 2015-11-06 23:17:11 +01:00
David FORT
5fbf26acf2 Add an UDP appender to wLog
This appender allows to receive the logs over a network connection using UDP packets.
You can see the logs using a listening netcat, for example: nc -ul 127.0.0.1 20000.
2015-11-04 18:11:19 +01:00
Hardening
3d6e1fb418 Merge pull request #2951 from bmiklautz/friday
Misc fixes
2015-11-02 10:50:16 +01:00
David FORT
2a8de84342 Take in account @bmiklautz remarks
* I have added a function to set the journal identifier
* the appender name has been changed from SYSTEMD to JOURNALD
2015-11-01 21:34:03 +01:00
David FORT
e3915b66b7 Fix the env var leak 2015-10-30 20:22:25 +01:00
David FORT
89156e53b7 Use unbuffered output 2015-10-30 20:20:42 +01:00
David FORT
9ea301983d Adds a systemd journal appender 2015-10-30 14:50:14 +01:00
Bernhard Miklautz
a011719831 Merge pull request #2940 from hardening/syslog_appender
Add a wLog syslog appender
2015-10-29 18:44:14 +01:00
David FORT
8d2aadfccd Fixed a warning 2015-10-29 18:33:42 +01:00
David FORT
c2a322f4d0 Support syslog type for the WLOG_APPENDER env var 2015-10-29 18:31:22 +01:00
Bernhard Miklautz
ab05a79c21 winpr/stream: don't allow 0-size streams 2015-10-23 18:38:41 +02:00
Bernhard Miklautz
a9d81ad083 winpr: fix compiler warning
winpr/libwinpr/utils/wlog/wlog.c: In function ‘WLog_PrintMessageVA’:
winpr/libwinpr/utils/wlog/wlog.c:234:7: warning: ‘status’ may be
		used uninitialized in this function [-Wmaybe-uninitialized]
	BOOL status;
	      ^

gcc 4.9.2
2015-10-23 18:37:39 +02:00
Martin Fleisz
08cbcb3577 wlog: Fix variable definitions 2015-10-23 12:08:20 +02:00
David FORT
d9080312bc Adapt to last wLog changes 2015-10-22 10:54:21 +02:00
David FORT
720c879661 Add a wLog syslog appender 2015-10-22 10:37:49 +02:00
Martin Haimberger
b2398b3a9a wlog: fixed return values
wlog used to return an int but the only meaning
of the return value was:

 * negative ... error
 * 0 or positive ... success

but the positve returned value was 1 or some id of some
subsystem, nothing meaningful for the caller.

For a more meaningful returnvalue we now use BOOL.

If something goes wrong FALSE is returned.
2015-10-21 01:11:06 -07:00
Marc-André Moreau
87780a850d Merge branch 'master' of github.com:FreeRDP/FreeRDP into mbedtls 2015-10-09 15:58:50 -04:00
Marc-André Moreau
4f769866d7 winpr: make clean non-OpenSSL build possible (without schannel, makecert) 2015-10-09 15:57:41 -04:00
Marc-André Moreau
94a2f9533e winpr: start porting to non-OpenSSL 2015-10-05 16:23:44 -04:00
MartinHaimberger
d4d360f6a4 Merge pull request #2859 from akallabeth/resource_leak_fix
Fixes API misuse and logic errors
2015-09-15 14:45:42 +02:00