Return-Path: X-Original-To: apmail-celix-dev-archive@www.apache.org Delivered-To: apmail-celix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E3DC10DEC for ; Wed, 19 Nov 2014 20:41:47 +0000 (UTC) Received: (qmail 27451 invoked by uid 500); 19 Nov 2014 20:41:46 -0000 Delivered-To: apmail-celix-dev-archive@celix.apache.org Received: (qmail 27420 invoked by uid 500); 19 Nov 2014 20:41:46 -0000 Mailing-List: contact dev-help@celix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@celix.apache.org Delivered-To: mailing list dev@celix.apache.org Received: (qmail 27408 invoked by uid 99); 19 Nov 2014 20:41:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2014 20:41:46 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [85.13.132.30] (HELO dd7632.kasserver.com) (85.13.132.30) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2014 20:41:41 +0000 Received: by dd7632.kasserver.com (Postfix, from userid 1085) id CE59A158039C; Wed, 19 Nov 2014 21:40:18 +0100 (CET) To: dev@celix.apache.org Subject: RE: svn commit: r1640622 - =?UTF-8?Q?/celix/trunk/log=5Fservice/p?= =?UTF-8?Q?ublic/src/log=5Fhelper=2Ec?= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 19 Nov 2014 21:40:18 +0100 From: Bjoern Petri In-Reply-To: <6C2434209962DC46B88345CA85C334A2025B23CD3177@Courier.syntech.org> References: <20141119194521.C36E02388A5E@eris.apache.org> <6C2434209962DC46B88345CA85C334A2025B23CD3177@Courier.syntech.org> Message-ID: <20dfa78389f4ae511b74c73e3ad050f8@mail.sundevil.de> X-Sender: bjoern.petri@sundevil.de User-Agent: Roundcube Webmail/1.0.0 X-Virus-Checked: Checked by ClamAV on apache.org Nowhere. I just replaced it. On 2014-11-19 21:29, Daniel Parker wrote: > Where is CELIX_LOG_ENABLE_STDOUT_FALLBACK_PROPERTY_NAME declared? > > Daniel Parker > > -----Original Message----- > From: bpetri@apache.org [mailto:bpetri@apache.org] > Sent: Wednesday, November 19, 2014 14:45 > To: commits@celix.apache.org > Subject: svn commit: r1640622 - > /celix/trunk/log_service/public/src/log_helper.c > > Author: bpetri > Date: Wed Nov 19 19:45:21 2014 > New Revision: 1640622 > > URL: http://svn.apache.org/r1640622 > Log: > CELIX-182: add property to enable stdout print fallback when > log_service is not available > > Modified: > celix/trunk/log_service/public/src/log_helper.c > > Modified: celix/trunk/log_service/public/src/log_helper.c > URL: > http://svn.apache.org/viewvc/celix/trunk/log_service/public/src/log_helper.c?rev=1640622&r1=1640621&r2=1640622&view=diff > ============================================================================== > --- celix/trunk/log_service/public/src/log_helper.c (original) > +++ celix/trunk/log_service/public/src/log_helper.c Wed Nov 19 19:45:21 > +++ 2014 > @@ -1,8 +1,32 @@ > +/** > + *Licensed to the Apache Software Foundation (ASF) under one *or more > +contributor license agreements. See the NOTICE file *distributed > with > +this work for additional information *regarding copyright ownership. > +The ASF licenses this file *to you under the Apache License, Version > +2.0 (the *"License"); you may not use this file except in compliance > +*with the License. You may obtain a copy of the License at > + * > + * http://www.apache.org/licenses/LICENSE-2.0 > + * > + *Unless required by applicable law or agreed to in writing, > *software > +distributed under the License is distributed on an *"AS IS" BASIS, > +WITHOUT WARRANTIES OR CONDITIONS OF ANY > + * KIND, either express or implied. See the License for the > *specific > +language governing permissions and limitations *under the License. > + */ > +/* > + * log_helper.c > + * > + * \date Nov 10, 2014 > + * \author href="mailto:celix-dev@incubator.apache.org">Apache Celix Project > Team > + * \copyright Apache License, Version 2.0 */ > > #include > #include > > - > #include "bundle_context.h" > #include "service_tracker.h" > #include "celix_threads.h" > @@ -13,11 +37,15 @@ > > #include "log_helper.h" > > +#define LOGHELPER_ENABLE_STDOUT_FALLBACK_PROPERTY_NAME > "LOGHELPER_ENABLE_STDOUT_FALLBACK" > + > + > struct log_helper { > bundle_context_pt bundleContext; > service_tracker_pt logServiceTracker; > celix_thread_mutex_t logListLock; > array_list_pt logServices; > + bool stdOutFallback; > }; > > celix_status_t logHelper_logServiceAdded(void *handle, > service_reference_pt reference, void *service); @@ -36,8 +64,16 @@ > celix_status_t logHelper_create(bundle_c > } > else > { > + char* stdOutFallbackStr = NULL; > (*loghelper)->bundleContext = context; > (*loghelper)->logServiceTracker = NULL; > + (*loghelper)->stdOutFallback = false; > + > + bundleContext_getProperty(context, > +CELIX_LOG_ENABLE_STDOUT_FALLBACK_PROPERTY_NAME, &stdOutFallbackStr); > + > + if (stdOutFallbackStr != NULL) { > + (*loghelper)->stdOutFallback = true; > + } > > pthread_mutex_init(&(*loghelper)->logListLock, NULL); > arrayList_create(&(*loghelper)->logServices); > @@ -145,7 +181,7 @@ celix_status_t logHelper_log(log_helper_ > } > > > - if (!logged) { > + if (!logged && loghelper->stdOutFallback) { > char *levelStr = NULL; > > switch (level) {