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 #include <stdint.h>
26 
27 using namespace ns3;
28 
55 NS_LOG_COMPONENT_DEFINE("sat-log-example");
56 
57 int
58 main(int argc, char* argv[])
59 {
60  LogComponentEnable("sat-log-example", LOG_LEVEL_INFO);
61  LogComponentEnable("SatLog", LOG_LEVEL_INFO);
62 
64  Config::SetDefault("ns3::SatEnvVariables::SimulationCampaignName", StringValue("example-log"));
65  Config::SetDefault("ns3::SatEnvVariables::SimulationTag", StringValue(""));
66  Config::SetDefault("ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(true));
67 
68  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_GENERIC,
69  "",
70  "Logging for generic messages started");
71  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_INFO, "", "Logging for info messages started");
72  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_WARNING,
73  "",
74  "Logging for warning messages started");
75  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_ERROR, "", "Logging for error messages started");
76  Singleton<SatLog>::Get()->AddToLog(SatLog::LOG_CUSTOM,
77  "_customTag",
78  "Logging for custom messages started");
79 
80  Simulator::Run();
81  Simulator::Destroy();
82 
83  return 0;
84 }
@ LOG_ERROR
LOG_ERROR.
Definition: satellite-log.h:67
@ LOG_WARNING
LOG_WARNING.
Definition: satellite-log.h:66
@ LOG_CUSTOM
LOG_CUSTOM.
Definition: satellite-log.h:68
@ LOG_GENERIC
LOG_GENERIC.
Definition: satellite-log.h:64
@ LOG_INFO
LOG_INFO.
Definition: satellite-log.h:65
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.