Skip to content
  • Harald Welte's avatar
    Call osmo_init_logging() before static BTS constructor · 3e51d3e5
    Harald Welte authored
    The BTS constructor uses functions of libosmocore that could in turn
    want to log something.  This requires the logging to be initialized
    before.
    
    The only way to achieve this is to add an __attribute__((constructor))
    function *before* the BTS constructor is being run.
    
    This solution might not be elegant, but  I guess it's the only way to
    initialize a C library before calling C++ constructors of global static
    instance of a class.
    
    In case anyone comes up with a better / cleaner approach, we can always
    change later.
    
    This change requires libosmocore >= 0.10.1, as only that permits
    multiple calls to osmo_init_logging() which may now occur.
    
    Change-Id: I28dc4f0db229518348c92413959fed5ae85d753d
    3e51d3e5