File tree Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Expand file tree Collapse file tree 4 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 33CCompositor::CCompositor () {
44 m_szInstanceSignature = GIT_COMMIT_HASH + std::string (" _" ) + std::to_string (time (NULL ));
55
6+ Debug::init (m_szInstanceSignature);
7+
68 Debug::log (LOG, " Instance Signature: %s" , m_szInstanceSignature.c_str ());
79
810 setenv (" HYPRLAND_INSTANCE_SIGNATURE" , m_szInstanceSignature.c_str (), true );
Original file line number Diff line number Diff line change 11#include " Log.hpp"
22#include " ../defines.hpp"
3+ #include " ../Compositor.hpp"
34
45#include < fstream>
56#include < iostream>
67
7- void Debug::init () {
8+ void Debug::init (std::string IS ) {
89 if (ISDEBUG)
9- logFile = " /tmp/hypr/hyprlandd- " + std::to_string ( time ( NULL )) + " .log" ;
10+ logFile = " /tmp/hypr/" + IS + " /hyprlandd .log" ;
1011 else
11- logFile = " /tmp/hypr/hyprland- " + std::to_string ( time ( NULL )) + " .log" ;
12+ logFile = " /tmp/hypr/" + IS + " /hyprland .log" ;
1213}
1314
1415void Debug::log (LogLevel level, const char * fmt, ...) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ enum LogLevel {
1212};
1313
1414namespace Debug {
15- void init ();
15+ void init (std::string IS );
1616 void log (LogLevel level, const char * fmt, ...);
1717
1818 inline std::string logFile;
Original file line number Diff line number Diff line change 33#include " Compositor.hpp"
44#include " config/ConfigManager.hpp"
55#include " init/initHelpers.hpp"
6+ #include < iostream>
67
78// I am a bad bad boy and have used some global vars here,
89// just for this file
@@ -21,19 +22,17 @@ int main(int argc, char** argv) {
2122
2223 system (" mkdir -p /tmp/hypr" );
2324
24- Debug::init ();
25-
2625 if (!ignoreSudo) {
2726 if (Init::isSudo ()) {
28- Debug::log (CRIT, " Hyprland shall not be run as the root user. If you really want to, use the --i-am-really-stupid flag." ) ;
29- return 1 ;
27+ std::cout << " Hyprland shall not be run as the root user. If you really want to, use the --i-am-really-stupid flag.\n " ;
28+ return 1 ;
3029 }
3130 } else {
32- Debug::log (WARN, " Running with ignored root checks, I surely hope you know what you're doing." ) ;
31+ std::cout << " Running with ignored root checks, I surely hope you know what you're doing.\n " ;
3332 sleep (1 );
3433 }
3534
36- Debug::log (LOG, " Welcome to Hyprland!" ) ;
35+ std::cout << " Welcome to Hyprland!\n " ;
3736
3837 // let's init the compositor.
3938 // it initializes basic Wayland stuff in the constructor.
You can’t perform that action at this time.
0 commit comments