Jump to content

Sanjix9

member
  • Posts

    4
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Sanjix9

  1. What is this "Improved TraceError" ?

    I always get bored with the coding style while coding.

    Exmaple Old:

    import dbg
    value = 15
    dbg.TraceError("Testing Code {}".format(value))
    
    syserr output
    0717 14:46:21398 :: Testing Code 15


    This output is very difficult, and I constantly need to do "import" repeatedly.
    It doesn't show in which file and on which line the output is given.
    I have improved this significantly.
     

    Exmaple New:

    value = 15
    printb("Testing Code {}".format(value))
    
    syserr output
    0717 14:46:21398 :: [Name:intrologin.py Line:188] Testing Code 15


    This is the hidden content, please
     or 
    This is the hidden content, please

     

    • Metin2 Dev 47
    • Good 6
    • Love 2
    • Love 6
  2. thx

    extra func:

    pythonitemmodule.cpp open

    search

    TraceError("Cannot find item by %d", iIndex);

    add above

     

    	PyThreadState* tstate = PyThreadState_GET();
    	if (tstate)
    	{
    		for (PyFrameObject* frame = tstate->frame; frame; frame = frame->f_back)
    		{
    			PyCodeObject* f_code = frame->f_code;
    			if (!f_code || !f_code->co_filename || !f_code->co_name)
    				continue;
    
    			const char* filename = PyString_AsString(f_code->co_filename);
    			const char* funcname = PyString_AsString(f_code->co_name);
    			TraceError("filename=%s, name=%s", filename, funcname);
    		}
    	}

     

    • Good 1
    • Love 1
    • Love 1
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.