Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with printing Logging and build dynamic Framework from source code #1015

Open
maiquannguyen opened this issue Jun 24, 2024 · 1 comment

Comments

@maiquannguyen
Copy link

1. Logging wont write to file when not in debug mode, and should not using print for log
The logging function wont work when scheme not in debug mode, both from write log to file and print the message to console.
I understand that should not print log to console when not in debug mode, but instead of using debugPrint, in Log file the code was like this

func print(_ object: Any) {
    // Only allowing in DEBUG mode
    #if DEBUG
    Swift.print(object)
    #endif
}

Also the function for check if logging enable isLoggingEnabled, always return false when it is not in Debug.

private class func isLoggingEnabled(for currentLevel: LogLevel) -> Bool {
        #if !(DEBUG)
        return false
        #endif
        
        if currentLevel.rawValue < Log.logLevel.rawValue {
            return false
        }
        
        return true
    }

It will block write log to file, it should not have check for DEBUG, if using debugPrint function instead of print.

2. The xcframework build command guide from readme file is not really working
The current command for archive simulator framework only work on simulator on macbook with intel chip, it not work on macbook which run m1 chip.

xcodebuild archive \
	only_active_arch=NO \
	defines_module=YES \
	SKIP_INSTALL=NO \
	-workspace PrebidMobile.xcworkspace \
	-scheme "${schemes[$n]}" \
	-configuration Release \
	-arch x86_64 \
	-sdk "iphonesimulator" \
	-derivedDataPath $XCODE_BUILD_DIR \
	-archivePath "$XCODE_ARCHIVE_DIR/${schemes[$n]}$POSTFIX_SIMULATOR.xcarchive" \

Because the arch is x86_64, now m1 macbook simulator already run with arm architecture chip.
It should be update like this

xcodebuild archive \
	only_active_arch=NO \
	defines_module=YES \
	SKIP_INSTALL=NO \
	-workspace PrebidMobile.xcworkspace \
	-scheme "${schemes[$n]}" \
	-configuration Release \
	-destination 'generic/platform=iOS Simulator' \
	-derivedDataPath $XCODE_BUILD_DIR \
	-archivePath "$XCODE_ARCHIVE_DIR/${schemes[$n]}$POSTFIX_SIMULATOR.xcarchive" \

So it can run on both Macbook with intel chip and Apple chip simulators.

***May i suggest a PR for this ? ***

@jsligh
Copy link
Collaborator

jsligh commented Jul 1, 2024

@maiquannguyen you are free to create a PR for fixes for these issues. If you do not have the time and/or ability to fix this yourself, this will be added to the list of issues myself and the Prebid Mobile Committee will triage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

2 participants