sat-log-example.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Magister Solutions
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Frans Laakso <frans.laakso@magister.fi>
19  *
20  */
21 
22 #include "ns3/core-module.h"
23 #include "ns3/satellite-module.h"
24 
25 using namespace ns3;
26 
53 NS_LOG_COMPONENT_DEFINE("sat-log-example");
54 
55 int
56 main(int argc, char* argv[])
57 {
58  LogComponentEnable("sat-log-example", LOG_LEVEL_INFO);
59  LogComponentEnable("SatLog", LOG_LEVEL_INFO);
60 
62  Config::SetDefault("ns3::SatEnvVariables::SimulationCampaignName", StringValue("example-log"));
63  Config::SetDefault("ns3::SatEnvVariables::SimulationTag", StringValue(""));
64  Config::SetDefault("ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(true));
65 
66  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_GENERIC,
67  "",
68  "Logging for generic messages started");
69  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_INFO, "", "Logging for info messages started");
70  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_WARNING,
71  "",
72  "Logging for warning messages started");
73  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_ERROR, "", "Logging for error messages started");
74  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_CUSTOM,
75  "_customTag",
76  "Logging for custom messages started");
77 
78  Simulator::Run();
79  Simulator::Destroy();
80 
81  return 0;
82 }
@ LOG_ERROR
LOG_ERROR.
Definition: satellite-log.h:65
@ LOG_WARNING
LOG_WARNING.
Definition: satellite-log.h:64
@ LOG_CUSTOM
LOG_CUSTOM.
Definition: satellite-log.h:66
@ LOG_GENERIC
LOG_GENERIC.
Definition: satellite-log.h:62
@ LOG_INFO
LOG_INFO.
Definition: satellite-log.h:63
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.