Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:14

0001 /*
0002  * Copyright (c) 2019 Opticks Team. All Rights Reserved.
0003  *
0004  * This file is part of Opticks
0005  * (see https://bitbucket.org/simoncblyth/opticks).
0006  *
0007  * Licensed under the Apache License, Version 2.0 (the "License"); 
0008  * you may not use this file except in compliance with the License.  
0009  * You may obtain a copy of the License at
0010  *
0011  *   http://www.apache.org/licenses/LICENSE-2.0
0012  *
0013  * Unless required by applicable law or agreed to in writing, software 
0014  * distributed under the License is distributed on an "AS IS" BASIS, 
0015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0016  * See the License for the specific language governing permissions and 
0017  * limitations under the License.
0018  */
0019 
0020 #include "OPTICKS_LOG.hh"
0021 
0022 
0023 
0024 void test_offset_level_logging()
0025 {
0026     plog::Severity level = info ; 
0027     sLOG(level,4)  << " hello+4 " ; 
0028     sLOG(level,3)  << " hello+3 " ; 
0029     sLOG(level,2)  << " hello+2 " ; 
0030     sLOG(level,1)  << " hello+1 " ; 
0031     sLOG(level,0)  << " hello+0 " ; 
0032     sLOG(level,-1) << " hello-1 " ; 
0033     sLOG(level,-2) << " hello-2 " ; 
0034     sLOG(level,-3) << " hello-3 " ; 
0035     sLOG(level,-4) << " hello-4 " ; 
0036 }
0037 
0038 
0039 void test_SLOG_SAr_dump()
0040 {
0041     // use SLOG::instance to recover commandline arguments 
0042     SLOG* slog = SLOG::instance ; 
0043     LOG(info) << " slog " << slog ; 
0044     assert(slog && "OPTICKS_LOG is needed to instanciate SLOG"); 
0045     const SAr& args = slog->args ; 
0046     args.dump(); 
0047     LOG(info) << " args.argc " << args._argc ; 
0048     for(int i=0 ; i < args._argc ; i++)  LOG(info) << i << ":" << args._argv[i] ; 
0049 }
0050 
0051 
0052 
0053 int main(int argc, char** argv)
0054 {
0055     OPTICKS_LOG(argc, argv);
0056     //OPTICKS_ELOG("EmbeddedLogTest");
0057 
0058     //test_offset_level_logging() ;
0059     test_SLOG_SAr_dump();
0060 
0061     return 0 ; 
0062 }
0063 // om-;TEST=OPTICKS_LOG_Test om-t