Commit Graph

53 Commits

Author SHA1 Message Date
Carsten Haitzler fe56edae3f systemd - make libsystemd use/supprot entirely runtime "dlopened"
so i've moved all systemd and elogind support to be runtime only with
dlopen (eina_module) of libsystemd.so.0 (or libelogind.so.0 for elput)
and finding of symbols manually at runtime (if the right code paths or
env vars are set), thus remvoing the need to decide at compile time if
efl needs systemd support or not as it no longer needs systemd
headers/libs at compile time and just at runtime. this simplifies
building a bit and makes efl more adaptive to the final target system
at runtime.
2020-05-18 09:36:55 +01:00
Carsten Haitzler 5c8942bf39 eina log bt - on by default always if unwind found
i'm tried of telling people how to turn this on. enough. on by
default. if you dont want bt's and its just some helpful log output
then just printf it or use WRN, INF and set log levels...
2020-03-12 14:40:14 +00:00
Marcel Hollerbach b6c713c937 eina_log: ensure that we do not spam journald with our intree binaries
EFL_RUN_IN_TREE is set for all binaries that are executed during build
time, and test suites. With this commit we are ensuring that we are not
sending messages during that time to journald, otherwise we would waste
a lot of time + we would create a lot of unneccessary log messages.

(eina test suite runtime with journald hook: 11.21s without journald
hook: 0.57s)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D10076
2019-09-23 15:52:27 +02:00
Marcel Hollerbach 5ff0c3cc15 eina_log: do not fallback to INFO when we run with systemd support
INFO is a way too verbose log domain, this lead to the fact that we
spammed journald before the first frame with ~200-300 messages
(depending on the setup) which is quite a lot. Additionally, this also
lead to the fact that we often TIMEOUT our own tests.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D10075
2019-09-23 11:50:43 +02:00
Carsten Haitzler 5f1e44ddad eina log - we exceet 24 domains alrready out of the box, so increase
this avoids more reallocs since we already use more than 24 domains...
go up to 64.
2019-08-07 21:20:00 +01:00
Vincent Torri ce9cad3a3b Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary
Test Plan: compilation

Reviewers: raster, zmike, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8903
2019-05-16 13:48:59 -04:00
Mike Blumenkrantz 69c54cdabb eina_log: reset logging callback to default when null is set as the callback
Summary:
passing null here causes any log message to crash the app and is probably not
the intended result

Reviewers: cedric, segfaultxavi

Reviewed By: cedric, segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8513
2019-03-29 18:57:06 +01:00
Carsten Haitzler 2017c169e7 eina - fix warnigns of possibly too msall buffers for large numbers
strings would get  truncated thanks to snprintf but make buffers
bigger to avoid warning noise
2018-11-09 11:43:58 +00:00
Prince Kumar Dubey 030a3448fb eina: fix warning if EINA_SAFETY_CHECKS is disabled
Summary:
Putting local variable "d" under preprocessor flag "EINA_SAFETY_CHECKS" to avoid below warning, if "EINA_SAFETY_CHECKS" is disabled.
        1. local variable "d" is assigned but not used.
        2. If warning 1 is resolved then variable "d" will be unused.

Reviewers: raster, cedric

Reviewed By: cedric

Subscribers: jpeg, rajeshps

Differential Revision: https://phab.enlightenment.org/D5321

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-10-16 13:36:12 -07:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Mike Blumenkrantz 7b4e9f5d77 eina_log: make a log level of 0 disable the log domain
this has always been specified in the docs as the means by which a log domain
is disabled

@fix
2017-06-23 17:43:44 -04:00
Daniel Zaoui 5f268ec26a First patch of the Eina Debug layer rewriting
Eina Debug is a new layer aimed for EFL debugging. It offers scalability
by allowing registration of operations not specific to EFL core.

The protocol is simple and the APIs try to provide as much
functionalities/freedom as possible.
2017-06-05 08:51:49 +03:00
Carsten Haitzler 330368c10c eina log - try and fix coverity complaint about integer overflow again
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.

CID 1361219
2017-04-18 17:30:50 +09:00
Carsten Haitzler f3f032e63f eina log - try and fix coverity complaint about integer overflow again
it seems coverity didn't like our checks like if end - start > 0xffff
then dont do anything. this should effectively stop any issues but
seemingly not, so try another way to keep coverity happy.

CID 1361220
2017-04-18 17:30:50 +09:00
Carsten Haitzler b44093c193 eina log bt - make it an eaven easier copy & paste to get a bt now
just copy & paste into a terminal and hit enter.
2017-01-31 23:01:50 +09:00
Carsten Haitzler 6a3a4a4124 eina log - explain how to humanify the output for bts when printed 2016-11-17 18:41:32 +09:00
Vincent Torri 79fadd184f Eina: fix colors messages in MSYS2
With MSYS1 or cygwin 1.5, or DOS console, the display is done by redirecting
stdout and al. So to change the colors, the Win32 API of the console must be
used.
On the contrary, the terminals based on mintty (like cygwin 1.8 terminal or MSYS2)
the redirection is done with pipes, so the Win32 API of the console does not
work when changing the colors and we can use the POSIX colors of printf.

This patch is fixing the eina code which alwayss use the Win32 API of the console
on Windows, even if mintty-based terminals are used
2016-09-16 14:48:33 +01:00
Carsten Haitzler 83752435cf eina log - handle possible overflow from high mem (last few bytes) or env
fixes CID 1361219
if you had an env var a few gb in size or we had stuff in the last bit
of memory address space this might be an issue, but that won't happen.

@fix
2016-08-06 15:53:18 +09:00
Carsten Haitzler 20c6bd296b eina log - keep coverity happy with potential ptr comparison overflow
fixes CID 1361220

in theory yes end minus start could be insanely huge or end be very
high in memory thus causing an overflow. this would have to be in the
last few bytes of memory space, so it never going to happen. and the
input from the env var has to be sane anyway as its user controlled.

@fix
2016-08-06 15:50:17 +09:00
Jean Guyomarc'h 20df2a5d60 eina: mix possibly misleading indentation 2016-03-12 22:57:21 +01:00
Jean Guyomarc'h 8034a96108 eina: remove un-necessary tests before freeing memory
free() is specified to do nothing at all when taking NULL as input.
2016-03-12 22:57:21 +01:00
Jean-Philippe Andre a4270b25a3 eina log: print formatted string when log domain is invalid
Before this patch, eina_log would simply record a non-formatted
entry like:
  unknown domain -1, original message format 'proxy=%p, obj=%p'

This was not very useful as even if the log domain is invalid, the
message itself might be relevant (often those are ERR logs).

Now the message format is roughly the same as the default format,
except that the line info comes from the original message (and
doesn't refer to eina_log.c).

Backtrace printing will happen at the same level as the original
log level, in order to avoid log pollution in case DBG logs are
printed with an invalid domain (and CRI would trigger bt).

I actually wonder if the logs shouldn't actually be forwarded
to the standard log callback instead of just stderr. This may
be useful for logging with dlog or journald (atm we will simply
lose all logs without a valid domain). This would mean eina_log
itself requires a log domain.
2016-02-17 16:12:35 +09:00
Jean-Philippe Andre 1f75cfc3cf Eina log: Disable backtrace by default for dev builds
The EINA_LOG_BACKTRACE thing is aimed at production environments,
so we can extract a backtrace from a log file post-mortem, but not
for continuous development of EFL itself.

I know this should make a few people happy.
2015-12-15 16:01:51 +09:00
Jean-Philippe Andre 6bc24b4794 Eina log: Fix meaning of EINA_LOG_BACKTRACE env
Most eina log env vars mean "if loglevel <= val then print log"
but eina_log_backtrace was "if loglevel < val" which I thought
was a bit confusing. The default behaviour is unchanged.
2015-12-15 15:25:55 +09:00
Carsten Haitzler dad345e574 Revert "eina: change default log level at which we display backtrace."
This reverts commit 05c18876b3.

i endabled backtraces by DEFAULT because it is otherwise pretty damned
hard to get them from things like enlightenment, or on tizen apps as
running them on the cmdline and having them work is close to
impossible. yes it's noise. FIX THE ERRORS then. this commit is just
like turning off gcc etc. warnings because the code is too noisy in
compilation with them on. it's a bug. fix it. the bt lets you do that
without gdb or re-executing AGAIN with an env var and HOPING to find
the bug the next time around.

not to mention efl programming docs cover this backtrace and say it
is on by default and how to get useful info out of this. this makes
the elf docs a lie by removing what is documented as default.

@fix
2015-10-04 17:59:47 +09:00
Cedric BAIL 05c18876b3 eina: change default log level at which we display backtrace.
We mostly use in our code base ERR in conjunction with system related error. This
doesn't require any information from who did call that function to get debugged and
is creating way to much noise with little value.
2015-08-15 12:53:00 +02:00
Jean-Philippe Andre 22ef03cd53 Eina log: Fix previous commit (ERR & CRI -> bt)
This was a < comparison, not <=
I don't totally agree on taking the bts for each error... just try
to cat a binary file in terminology and have fun.
2015-05-12 19:37:25 +09:00
Jean-Philippe Andre 65b53f4a37 Eina log: Enable backtrace only for CRI and ERR by default
Using EINA_LOG_LEVEL=4 for standard debugging has now become
absolutely horrible (and slow!). Backtraces may make sense in
case of ERR and CRI messages, but are just pollution for other
levels.

WRN could be argued over but the old env variable is still there
so just use it if you want backtraces:

$ export EINA_LOG_BACKTRACE=2
2015-05-12 19:06:00 +09:00
Carsten Haitzler 664708b817 eina - start a much improved eina dbug infra and have eina_log use it
this makes eina_log give bt's for all error logs. this is very useful
in finding just where a problem happens. the problem int he past is
that these have not been too useful due to backtrace_symbols() being
"useless". thus use the eina_btlog tool i added too.

also started infra for a debug monitor that can use the backtrace
infra to collect runtime stats ANY TIME for a process (don't need to
run under a debugger).

@feat
2015-05-08 14:13:17 +09:00
michelle legrand 9579624765 eina: fix Eina_Log to only try to free non deleted log.
@fix
2015-02-11 17:03:37 +01:00
Vasyl Vavrychuk b613404452 eina: fix eina_log with journald.
Summary:
Nothing was printed to journald before because sd_journal_send_with_location
expects file and line to be of the NAME=VALUE form.

Change-Id: I382b82b665558fddebae61b7d0a8d4de87638511
Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@globallogic.com>

Reviewers: kuri, cedric

Reviewed By: cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1865

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-01-13 16:18:24 +01:00
Vincent Torri 9631585f24 efl: remove Windows CE support 2014-07-13 15:17:17 +02:00
Felipe Magno de Almeida 416376e03c eina-cxx: Added eina_log support for C++, using IOStreams syntax
Summary:
Added eina_log support for C++ using the following macros:

For logging into a domain:

EINA_CXX_DOM_LOG
EINA_CXX_DOM_LOG_CRIT
EINA_CXX_DOM_LOG_ERR
EINA_CXX_DOM_LOG_INFO
EINA_CXX_DOM_LOG_DBG
EINA_CXX_DOM_LOG_WARN

And for logging into the default domain:

EINA_CXX_LOG
EINA_CXX_LOG_CRIT
EINA_CXX_LOG_ERR
EINA_CXX_LOG_INFO
EINA_CXX_LOG_DBG
EINA_CXX_LOG_WARN

The usage is simple as can be seen in the tests:

  efl::eina::log_domain domain("error_domain_name");
  domain.set_level(efl::eina::log_level::critical);
  EINA_CXX_DOM_LOG_CRIT(domain, "something went wrong with the following error: " << error);

@feature

Reviewers: cedric

CC: raster, savio, cedric, sanjeev

Differential Revision: https://phab.enlightenment.org/D605
2014-03-10 12:35:00 +09:00
Andy Williams 5913ce7ec8 eina_log: Update domain colouring when color_disable_set is called
After color_disable is set we should update the domain_str for each domain
as this cached the setting from when the domain was registered.
This required storing the colour within the domain for later use.
Fixes T1029
2014-02-26 04:02:33 +00:00
Cedric Bail 4225ef35e1 eina: fix build break on systemd based system. 2014-01-04 11:24:48 +09:00
Guillaume Friloux ec3d13d6c9 eina - Fix compilation warning in eina_log_print_cb_journald.
vasprintf can return -1, in which case the buffer is corrupted.
So we better handle this ...

gcc told me of this thanks to -Wunused-result when building package,
thank you gcc for your incredible powers.
2014-01-03 19:13:30 +01:00
Guillaume Friloux 1073bfcd44 eina - Fix coding style madness. 2014-01-03 19:10:16 +01:00
Cedric Bail 82d86ea42d eina: use Eina_Spinlock for Eina_Log. 2013-10-11 11:08:17 +09:00
Cedric Bail 9d2249c1a8 eina: fix Eina_Log restart. 2013-07-15 17:04:34 +09:00
Sebastian Dransfeld 336f6ec328 efl: formatting 2013-06-20 13:28:18 +02:00
Boris Faure e0372fc54d eina_log: screen-256color also support colors 2013-06-09 15:50:11 +02:00
Boris Faure 55b66a93d7 eina-log: xterm-256 (or terminology someday…) supports colors 2013-06-08 21:07:22 +02:00
Cedric BAIL ad406d7353 eina: use a global variable to hold the same string accross other library. 2013-03-29 11:44:48 +09:00
Cedric BAIL 6f6d425f0d eina: do not report timing for already stopped domain. 2013-03-27 22:37:15 +09:00
Cedric BAIL 1d5692baa6 eina: add eina_log_timing. 2013-03-27 21:43:45 +09:00
Cedric Bail 06ce7c2ede eina: add support for Systemd journal in Eina_Log.
NOTE: if you start your process with Systemd it will automatically use
Journald API. You will need to overide the default logging function to
change that behavior.
2013-03-16 22:49:32 +09:00
Lucas De Marchi db395ef7eb efl: Remove check for unistd.h
* unistd.h: is very useful, very old and very standard.



SVN revision: 82577
2013-01-10 20:25:26 +00:00
Gustavo Sverzut Barbieri 4668d04f04 efl: cleanup HAVE_THREADS and pthread usage outside of eina.
Eina now abstracts threads, so use that.

the touched files had the EFL_HAVE_THREADS as it's mandatory now.



SVN revision: 81935
2012-12-31 16:14:40 +00:00
Boris Faure d7b55afca2 eina: fix code indentation
SVN revision: 81660
2012-12-23 17:30:56 +00:00
Cedric BAIL df8fb6d989 efl: backport r78213.
SVN revision: 78216
2012-10-19 01:49:06 +00:00