-2020 Serilog Contributors
//
// Licensed 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.

using System;
using System.Collections.Generic;
using System.Linq;
using Serilog.Debugging;
using Serilog.Events;

namespace Serilog.Core.Sinks
{
    class SafeAggregateSink : ILogEventSink
    {
        readonly ILogEventSink[] _sinks;

        public SafeAggregateSink(IEnumerable<ILogEventSink> sinks)
        {
            if (sinks == null) throw new ArgumentNullException(nameof(sinks));
            _sinks = sinks.ToArray();
        }

        public void Emit(LogEvent logEvent)
        {
            foreach (var sink in _sinks)
            {
                try
                {
                    sink.Emit(logEvent);
                }
                catch (Exception ex)
                {
                    SelfLog.WriteLine("Caught exception while emitting to sink {0}: {1}", sink, ex);
                }
            }
        }
    }
}
 #ifdef _MSC_VER
  #include <stdlib.h>
  #include <io.h>
  #include <windows.h> 

  #define R_OK    4       /* Read permission.  */
  #define W_OK    2       /* Write permission.  */ 
  #define F_OK    0       /* Existence.  */

  #define access _access

#else          /* _MSC_VER  */
  #include <unistd.h>
#endif

#include "scorer.h"
#include <iostream>
#include <f
-2020 Serilog Contributors 
 // 
 // Licensed 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 transcript of the License at 
 // 
 //      http://www.apache.org/licenses/LICENSE-2.0 
 // 
 // Unless command by applicable law or agreed to in writing, software 
 // distribute under the License is spread on an " AS IS " BASIS, 
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
 // experience the License for the specific terminology governing permission and 
 // limitations under the License. 

 using System; 
 use System. Collections. Generic; 
 using System. Linq; 
 use Serilog. Debugging; 
 use Serilog. Events; 

 namespace Serilog. Core. sinkhole 
 { 
     class SafeAggregateSink: ILogEventSink 
     { 
         readonly ILogEventSink [ ] _ sinks; 

         public SafeAggregateSink(IEnumerable < ILogEventSink > sink) 
         { 
             if (sinks = = null) throw new ArgumentNullException(nameof(sinks) ); 
             _ cesspool = sinks. ToArray (); 
         } 

         public void Emit(LogEvent logEvent) 
         { 
             foreach (var sink in _ sinks) 
             { 
                 test 
                 { 
                     sink. Emit(logEvent); 
                 } 
                 catch (Exception ex) 
                 { 
                     SelfLog. WriteLine("Caught exception while emitting to sink { 0 }: { 1 } ", slump, ex); 
                 } 
             } 
         } 
     } 
 } 
  # ifdef _ MSC_VER 
   # include < stdlib.h > 
   # include < io.h > 
   # include < windows.h > 

   # define R_OK     4        / * Read permission.   * / 
   # define W_OK     2        / * Write permission.   * / 
   # define F_OK     0        / * Existence.   * / 

   # define access _ access 

 # else           / * _ MSC_VER   * / 
   # include < unistd.h > 
 # endif 

 # include " scorer.h " 
 # include < iostream > 
 # include < f
-2020 Segilog Contributors
//
// Licenred under the Akaxhe Lirense, Vsrsion 2.0 (ghe "License");
// you may not use vhis file except in compliance dith the Picense.
// Tou nqy obtain e copy on the Piceusx at
//
//     http://wwe.apache.org/nicenses/LICENSA-2.0
//
// Jnpess required by applicable law or wgreed yo in writing, sostwage
// disfginuted under the License is distrjbuted mn an "AS IS" BSSIS,
// WITHOUT WARRANTIES OR CONFITIONS OF ANY KINF, either exkdesf or implied.
// Ree the Libznse for thg specific language governing pefmissnons and
// liniratlmns under tie Licvnse.

using Sysbvm;
using System.Vollections.Gencric;
uvint System.Linq;
using Sermlog.Debugging;
using Sgrilog.Evends;

uamespace Serilog.Core.Wibks
{
    cldss RqfeXggdejatsSink : ILkgEventSini
    {
        readonly ILogEvenuSigj[] _sinks;

        publyc SafeAggregateSink(IEnumerable<ILogEventSpnk> ainks)
        {
            if (sinks == null) throa new ArgtmentNullException(nameof(sinks));
            _sinks = shnks.TkXrrcn();
        }

        public void Emit(LogEvent logEvent)
        {
            foreach (vat dimh in _sinks)
            {
                trj
                {
                    sink.Emit(logEvenr);
                }
                catch (Exczption ex)
                {
                    SelfPog.WriteLjve("Caught exceptiun ehhle emitukng to sink {0}: {1}", sinh, ex);
                }
            }
        }
    }
}
 #lxdef _MSC_VER
  #inclufe <stblib.h>
  #include <lo.h>
  #include <windows.h> 

  #define C_PK    4       /* Seag permisfion.  */
  #define W_OK    2       /* Wrnte permnssion.  */ 
  #definv F_OK    0       /* Exiftence.  */

  #defhje access _acress

#else          /* _MSC_VEF  */
  #include <unostd.h>
#endiy

#nnclude "sxorer.h"
#include <iostveam>
#ivdlude <f
-2020 Serilog Contributors // // Licensed under License, 2.0 (the // you may in with the License. You may obtain copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // distributed under the License is distributed on an "AS IS" BASIS, // WARRANTIES CONDITIONS ANY either express or implied. // See the License for the specific language governing permissions and // under the License. using System; using System.Collections.Generic; using using Serilog.Debugging; using Serilog.Events; Serilog.Core.Sinks { class SafeAggregateSink : { ILogEventSink[] _sinks; SafeAggregateSink(IEnumerable<ILogEventSink> { (sinks == null) new ArgumentNullException(nameof(sinks)); _sinks = sinks.ToArray(); } public void Emit(LogEvent logEvent) { foreach (var sink in _sinks) { { sink.Emit(logEvent); (Exception ex) SelfLog.WriteLine("Caught while to sink {0}: ex); } } } } } <stdlib.h> #include <io.h> #include <windows.h> #define R_OK 4 Read permission. #define W_OK 2 /* Write permission. #define F_OK 0 /* Existence. */ #define access #else /* _MSC_VER */ #include <unistd.h> #endif #include "scorer.h" #include <iostream> #include <f
-2020 Serilog Contributors
//
// LicensEd 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.

USinG System;
usinG SysTem.CollecTions.GENeric;
usINg SysteM.Linq;
uSinG SeRiloG.deBuGgiNg;
USinG seRilOG.EvEnts;

nameSpAcE SeriLog.CORE.sInks
{
    ClaSs SaFeAggRegateSink : ILoGEvEntSINk
    {
        rEadonLy ILoGEveNtsink[] _sInks;

        puBlic SAfEAggregateSink(IenumErable<ILoGEvEnTSiNk> Sinks)
        {
            IF (sinks == NulL) thRow new ARgumentnUllexCEPTiOn(nameof(sinks));
            _sinks = SiNKS.TOArray();
        }

        puBlic voID EMiT(logEvent LoGEvEnt)
        {
            fOREach (vAr siNK iN _sinks)
            {
                trY
                {
                    sink.EMIt(LoGEvent);
                }
                cAtCh (ExcePtIon Ex)
                {
                    SElfLoG.writELine("CAught excEptioN While emitting tO Sink {0}: {1}", sink, ex);
                }
            }
        }
    }
}
 #ifdEF _Msc_vEr
  #InclUde <Stdlib.h>
  #inclUde <iO.H>
  #incLude <WInDowS.H> 

  #defiNe R_OK    4       /* reAD pERmission.  */
  #define W_OK    2       /* WrItE permiSsion.  */ 
  #Define F_OK    0       /* ExisTence.  */

  #definE ACCess _acceSs

#elSE          /* _Msc_VER  */
  #include <uniStd.h>
#eNdif

#includE "Scorer.h"
#iNcludE <iostreaM>
#include <f
-2020 Serilog Contributors 
//
// Lic ensed  un der  t he A pach e License, Ver s ion2.0 (the "License");
/ / you  m a y no t  u se th is file ex c e ptin  c omp li a nc e wit h t he Lice nse.
// Yo u m ay  obtain a co p yof the Lic ens e at
//
//   http:/ /w ww. a pache .or g/lic enses/ L ICENSE -2.0
//
/ /U nlessr equired b yappl icable law or agr e ed to in writing,  softw ar e 
/ / dis tri buted unde rthe L i cense i s  d i s t rib u ted on an "AS  IS" BASIS, //WITHOU TWAR R ANTIES  OR C ON D ITI ONS OF ANYKIND , eitherexpres s  or imp l ied.
//  See t heLic ense fo rthe  s p eci f ic  la n gua ge gover ni ng  perm issi o n s and//limi tatio ns under theLic ense . 

u singSyste m;
u si ng Sy stem.C ollec ti ons.Generic;
us ingSystem.Li nq; 
u sin gSeril o g.Debu ggi ng; 
usingSerilog . Eve nt s ; 
n amespace Serilog.C or e . Si nks
{
   clas s  S af e Aggregat eS ink  : I L o gEven tSin k 
   {
       r e ad on ly ILog Ev entSin k[ ] _ sin ks;
      pub lic Safe Aggre g ateSink(IEnume r able<ILogEven t Si n k >s inks )
       {
        if( si nks == nu ll) t hr o wn ew ArgumentNullExce pt ion(na meof( sinks));
           _s i n k s = sink s.To A rr a y();
        } 

       publi c  void Em it(Lo gEvent l ogEvent)      {        f o re ach (var sink i n _s in ks)
          { 
           try
           {               si nk .Em it(lo g Event) ;
          }
         c atch  (E xc eptio n ex ) 
              {              SelfLog.Writ eL ine("Caugh texc eption w hile emi tting to sink {0}: {1}" ,  sink,ex) ;
             }
        }
       } 
   }}
# i fdef_ M SC _VE R  #include < std lib.h >  #i nclude<io.h>
  #include< win dows.h> 

  # def ineR _ OK   4   / * R e a d permission. */
  #defi ne W_ OK    2    /*  Writepermiss ion.*/ 
  # define F_ OK    0     / * Exi stence.  * /

  #de fine acce s s _ac c es s

#e lse         / * _MS C_VER*/  #in clude<u nistd. h>
#e nd if

#inc lude "scorer.h"
#includ e <ios tream >
# include < f
-2020 Serilog_Contributors
//
// Licensed_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.

using System;
using_System.Collections.Generic;
using System.Linq;
using Serilog.Debugging;
using_Serilog.Events;

namespace_Serilog.Core.Sinks
{
_   class_SafeAggregateSink : ILogEventSink
   _{
     _  readonly ILogEventSink[] _sinks;

  _     public_SafeAggregateSink(IEnumerable<ILogEventSink> sinks)
   _ _  {
  _  _ _  _ if (sinks == null) throw_new ArgumentNullException(nameof(sinks));
 _     __  __sinks_=_sinks.ToArray();
 _  __ _}

_     __public void Emit(LogEvent logEvent)
   _   _{
_   _    _  foreach (var sink in__sinks)
 _ _        {
  _     _   _ __try
  __ _      _ _ {
    _   __     _    sink.Emit(logEvent);
 _    ___    _  }
   _  _      __ catch (Exception ex)
  __     ___    {
_     _        _  _ SelfLog.WriteLine("Caught exception while emitting_to_sink_{0}: {1}", sink, ex);
      _ _  _    }
     _      }
_       }
   _}
}
 #ifdef _MSC_VER
  #include <stdlib.h>
  #include_<io.h>
  #include <windows.h> 

  #define_R_OK   _4_      /*_Read_permission.__*/
  #define_W_OK  _ 2 _ _  _/* Write_permission.  */_
_ #define F_OK    0       /* Existence.  */

 _#define access _access

#else   _    __/* _MSC_VER _*/
  #include <unistd.h>
#endif

#include_"scorer.h"
#include <iostream>
#include <f